grakel.graph_from_networkx

grakel.graph_from_networkx(X, node_labels_tag=None, edge_labels_tag=None, edge_weight_tag=None, as_Graph=False)[source][source]

Transform an iterable of networkx objects to an iterable of Graphs.

A function for helping a user that has a collection of graphs in networkx to use grakel.

Parameters
node_labels_tagstr or None

Define where to search for labels of nodes, inside the node attribute of each graph. If None no labels are assigned.

edge_labels_tagtuple

Define where to search for labels of edges, inside the edge attribute of each graph. If None no labels are assigned.

edge_weight_tagint

Define where to search for weights inside the edge attribute of each graph. If None 1.0 weights are assigned.

as_Graphbool, default=False

Return each output as a grakel.Graph object.

Returns
grakel_graphsgenerator

Returns a generator containing the same collections to be given as an input for any grakel kernel.

Examples using grakel.graph_from_networkx