Getting started: graph
operators
•
subgraph(G, nbunch) - induce subgraph of G on nodes in nbunch
•
union(G1, G2) - graph union, G1 and G2 must be disjoint
•
cartesian_product(G1, G2) - return Cartesian product graph
•
compose(G1, G2) - combine graphs identifying nodes common to both
•
complement(G) - graph complement
•
create_empty_copy(G) - return an empty copy of the same graph class
•
convert_to_undirected(G) - return an undirected representation of G
•
convert_to_directed(G) - return a directed representation of G
22
Getting started: graph input/output
• General read/write
• Read and write edge lists
• Data formats
• Node pairs with no data: 1 2
• Python dictionaries as data: 1 2 {'weight':7, 'color':'green'}
• Arbitrary data: 1 2 7 green
Dostları ilə paylaş: