Graph model
Plain graph
MolecularGraph.Graph.immutableplaingraph
— Methodimmutableplaingraph() -> ImmutablePlainGraph
immutableplaingraph(size::Int, edges) -> ImmutablePlainGraph
immutableplaingraph(graph::UndirectedGraph) -> ImmutablePlainGraph
Convert an arbitrary UndirectedGraph
into a ImmutablePlainGraph
.
ImmutablePlainGraph
is same as PlainGraph
except for availability of addnode!
and addedge!
, and no performance difference exists between these graphs. ImmutablePlainGraph
is mainly used for unit testing to check adverse effect of some graph algorithm implementations.
MolecularGraph.Graph.plaingraph
— Methodplaingraph(nodes, edges) -> PlainGraph{PlainNode,Edge}
Generate vector graph that have given nodes and edges represented by the list of node indices in integer and the list of pairs of node indices, respectively.
MolecularGraph.Graph.plaingraph
— Methodplaingraph(graph::OrderedGraph) -> PlainGraph
Convert an arbitrary OrderedGraph
into a PlainGraph
.
MolecularGraph.Graph.plaingraph
— Methodplaingraph(graph::UndirectedGraph) -> PlainGraph
Convert an arbitrary UndirectedGraph
into a PlainGraph
.
If the given graph has non-sequential indices (ex. subgraph view), node and edge indices are sorted in ascending order and are re-indexed.
MolecularGraph.Graph.plaingraph
— Methodplaingraph() -> PlainGraph
Generate empty PlainGraph
.
Hyper graph
MolecularGraph.Graph.plainhypergraph
— Methodplainhypergraph(size, edges) -> PlainHyperGraph
Generate hyper graph that have given size (number of nodes) and edges (Sets of nodes).
MolecularGraph.Graph.plainhypergraph
— Methodplainhypergraph(graph::HyperGraph) -> PlainHyperGraph
Convert an arbitrary HyperGraph
into a PlainHyperGraph
.
If the given graph has non-sequential indices (ex. subgraph view), node and edge indices are sorted in ascending order and are re-indexed.
MolecularGraph.Graph.plainhypergraph
— Methodplainhypergraph(graph::OrderedHyperGraph) -> PlainHyperGraph
Convert an arbitrary OrderedHyperGraph
into a PlainHyperGraph
.
MolecularGraph.Graph.plainhypergraph
— Methodplainhypergraph() -> PlainHyperGraph
Generate empty PlainGraph
.
Directed Acyclic Graph (DAG)
Bipartite Graph
MolecularGraph.Graph.twocoloring
— Methodtwocoloring(graph::UndirectedGraph)
Do 2-coloring and return two sets of nodes.