Generators - Small
==================

>>> from networkx import *

>>> from networkx.algorithms.isomorphism.isomorph import graph_could_be_isomorphic
>>> is_isomorphic=graph_could_be_isomorphic

Some small graphs
-----------------

>>> null=null_graph()


Test make_small_graph
---------------------

>>> d=["adjacencylist","Bull Graph",5,[[2,3],[1,3,4],[1,2,5],[2],[3]]]
>>> G=make_small_graph(d)
>>> is_isomorphic(G, bull_graph())
True

Test LCF_graph(n, shift_list, repeats)
--------------------------------------


If n<=0, then return the null_graph

>>> G=LCF_graph(-10,[1,2],100)
>>> is_isomorphic(G,null)
True
>>> G=LCF_graph(0,[1,2],3)
>>> is_isomorphic(G,null)
True
>>> G=LCF_graph(0,[1,2],10)
>>> is_isomorphic(G,null)
True


Test that LCF(n,[],0) == cycle_graph(n)

>>> G=LCF_graph(5,[],0)
>>> is_isomorphic(G,cycle_graph(5))
True
>>> G=LCF_graph(10,[],0)
>>> is_isomorphic(G,cycle_graph(10))
True
>>> G=LCF_graph(5,[],1)
>>> is_isomorphic(G,cycle_graph(5))
True
>>> G=LCF_graph(10,[],10)
>>> is_isomorphic(G,cycle_graph(10))
True

Generate the utility graph K_{3,3}

>>> G=LCF_graph(6,[3,-3],3)
>>> utility_graph=complete_bipartite_graph(3,3)
>>> is_isomorphic(G, utility_graph)
True


Test properties of named small graphs
-------------------------------------

>>> G=bull_graph()
>>> G.number_of_nodes() 
5
>>> G.number_of_edges() 
5
>>> sorted(G.degree().values())
[1, 1, 2, 3, 3]
>>> diameter(G)
3
>>> radius(G)
2

>>> G=chvatal_graph()
>>> G.number_of_nodes() 
12
>>> G.number_of_edges() 
24
>>> G.degree().values()==12*[4]
True
>>> diameter(G)
2
>>> radius(G)
2

>>> G=cubical_graph()
>>> G.number_of_nodes() 
8
>>> G.number_of_edges() 
12
>>> G.degree().values()==8*[3]
True
>>> diameter(G)
3
>>> radius(G)
3

>>> G=desargues_graph()
>>> G.number_of_nodes()
20
>>> 
G.number_of_edges()
30
>>> G.degree().values()== 20*[3]
True

>>> G=diamond_graph()
>>> G.number_of_nodes()  
4
>>> sorted(G.degree().values())
[2, 2, 3, 3]
>>> diameter(G) 
2
>>> radius(G) 
1

>>> G=dodecahedral_graph()
>>> G.number_of_nodes()  
20
>>> G.number_of_edges()  
30
>>> G.degree().values()==20*[3]  
True
>>> diameter(G) 
5
>>> radius(G) 
5

>>> G=frucht_graph()
>>> G.number_of_nodes()  
12
>>> G.number_of_edges()  
18
>>> G.degree().values()==12*[3]  
True
>>> diameter(G) 
4
>>> radius(G) 
3

>>> G=heawood_graph()
>>> G.number_of_nodes()  
14
>>> G.number_of_edges()  
21
>>> G.degree().values()==14*[3]  
True
>>> diameter(G) 
3
>>> radius(G) 
3


>>> G=house_graph()
>>> G.number_of_nodes()  
5
>>> G.number_of_edges()  
6
>>> sorted(G.degree().values())
[2, 2, 2, 3, 3]
>>> diameter(G) 
2
>>> radius(G) 
2

>>> G=house_x_graph()
>>> G.number_of_nodes()  
5
>>> G.number_of_edges()  
8
>>> sorted(G.degree().values())
[2, 3, 3, 4, 4]
>>> diameter(G) 
2
>>> radius(G) 
1

>>> G=icosahedral_graph()
>>> G.number_of_nodes()  
12
>>> G.number_of_edges()  
30
>>> G.degree().values()
[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]
>>> diameter(G) 
3
>>> radius(G) 
3

>>> G=krackhardt_kite_graph()
>>> G.number_of_nodes()  
10
>>> G.number_of_edges()  
18
>>> sorted(G.degree().values())
[1, 2, 3, 3, 3, 4, 4, 5, 5, 6]

>>> G=moebius_kantor_graph()
>>> G.number_of_nodes()  
16
>>> G.number_of_edges()  
24
>>> G.degree().values()==16*[3]
True
>>> diameter(G) 
4

>>> G=octahedral_graph()
>>> G.number_of_nodes()  
6
>>> G.number_of_edges()  
12
>>> G.degree().values()==6*[4]
True
>>> diameter(G) 
2
>>> radius(G) 
2

>>> G=pappus_graph()
>>> G.number_of_nodes()  
18
>>> G.number_of_edges()  
27
>>> G.degree().values()==18*[3]
True
>>> diameter(G) 
4


>>> G=petersen_graph()
>>> G.number_of_nodes()  
10
>>> G.number_of_edges()  
15
>>> G.degree().values()==10*[3]
True
>>> diameter(G) 
2
>>> radius(G) 
2

>>> G=sedgewick_maze_graph()
>>> G.number_of_nodes()  
8
>>> G.number_of_edges()  
10
>>> sorted(G.degree().values())
[1, 2, 2, 2, 3, 3, 3, 4]

>>> G=tetrahedral_graph()
>>> G.number_of_nodes()  
4
>>> G.number_of_edges()  
6
>>> G.degree().values()
[3, 3, 3, 3]
>>> diameter(G) 
1
>>> radius(G) 
1

>>> G=truncated_cube_graph()
>>> G.number_of_nodes()  
24
>>> G.number_of_edges()  
36
>>> G.degree().values()==24*[3]
True


>>> G=truncated_tetrahedron_graph()
>>> G.number_of_nodes()  
12
>>> G.number_of_edges()  
18
>>> G.degree().values()==12*[3]
True



>>> G=tutte_graph()
>>> G.number_of_nodes()  
46
>>> G.number_of_edges()  
69
>>> G.degree().values()==46*[3]
True


Test create_using with directed or multigraphs on small graphs

>>> DG=tutte_graph(create_using=DiGraph())
Traceback (most recent call last):
...
NetworkXError: Directed Graph not supported
>>> MG=tutte_graph(create_using=MultiGraph())
>>> MG.edges()==G.edges()
True
