Conversions¶
A small collection of utility methods in order to convert from/to other graph formats.
-
jgrapht.convert.
from_nx
(graph, any_hashable=True)[source]¶ Create a graph from a NetworkX graph.
- Parameters
graph (nx graph) – a graph
any_hashable (boolean) – if true the returned graph uses the same objects as the nx graph, otherwise integers are used. In the later case a renumbering is performed independently from any possible ordering in the original graph.
- Returns
a new graph
- Type
jgrapht graph
-
jgrapht.convert.
from_pydot
(graph)[source]¶ Create a graph from a pydot graph.
- Parameters
graph (pydot graph) – a graph
- Returns
a new graph
- Return type
jgrapht graph