Package NX :: Package generators :: Module small
[frames | no frames]

Module NX.generators.small

Various small and named graphs, together with some compact generators.


Function Summary
  bull_graph()
Return the Bull graph.
  chvatal_graph()
Return the Chvatal Graph.
  cubical_graph()
Return the 3-regular Platonic Cubical Graph.
  desargues_graph()
Return the Desargues graph.
  diamond_graph()
Return the Diamond Graph.
  dodecahedral_graph()
Return the Platonic Dodecahedral graph.
  frucht_graph()
Return the Frucht Graph.
  heawood_graph()
Return the Heawood graph, a (3,6) cage.
  house_graph()
Return the House graph (square with triangle on top).
  house_x_graph()
Return the House graph with a cross inside the house square.
  icosahedral_graph()
Return the Platonic Icosahedral Graph.
  krackhardt_kite_graph()
Return the Krackhardt Kite Social Network.
  LCF_graph(n, shift_list, repeats)
Return the cubic graph specified in LCF notation.
  make_small_graph(graph_description, create_using, **kwds)
Return the small graph described by graph_description and kwds.
  moebius_kantor_graph()
Return the Moebius-Kantor Graph.
  octahedral_graph()
Return the Platonic Octahedral Graph.
  pappus_graph()
Return the Pappus Graph.
  petersen_graph()
Return the Petersen Graph.
  sedgewick_maze_graph()
Return a small maze with a cycle.
  tetrahedral_graph()
Return the 3-regular Platonic Tetrahedral graph.
  truncated_cube_graph()
Return the skeleton of the truncated cube.
  truncated_tetrahedron_graph()
Return the skeleton of the truncated Platonic Tetrahedral Graph.
  tutte_graph()
Return the Tutte Graph.

Variable Summary
str __author__ = 'Aric Hagberg (hagberg@lanl.gov)\nPieter Sw...
str __credits__ = ''
str __date__ = '$Date: 2005/04/10 04:52:35 $'
str __revision__ = '$Revision: 1.24 $'

Function Details

bull_graph()

Return the Bull graph.

chvatal_graph()

Return the Chvatal Graph.

cubical_graph()

Return the 3-regular Platonic Cubical Graph.

desargues_graph()

Return the Desargues graph.

diamond_graph()

Return the Diamond Graph.

dodecahedral_graph()

Return the Platonic Dodecahedral graph.

frucht_graph()

Return the Frucht Graph.

The Frucht Graph is the smallest cubical graph whose automorphism group consists only of the identity element.

heawood_graph()

Return the Heawood graph, a (3,6) cage.

house_graph()

Return the House graph (square with triangle on top).

house_x_graph()

Return the House graph with a cross inside the house square.

icosahedral_graph()

Return the Platonic Icosahedral Graph.

krackhardt_kite_graph()

Return the Krackhardt Kite Social Network.

A 10 actor social network introduced by David Krackhardt to illustrate: degree, betweenness, centrality, closeness, etc. The traditional labeling is: Andre=1, Beverley=2, Carol=3, Diane=4, Ed=5, Fernando=6, Garth=7, Heather=8, Ike=9, Jane=10.

LCF_graph(n, shift_list, repeats)

Return the cubic graph specified in LCF notation.

LCF notation (LCF=Lederberg-Coxeter-Fruchte) is a compressed notation used in the generation of various cubic Hamiltonian graphs of high symmetry. See, for example, dodecahedral_graph, desargues_graph, heawood_graph and pappus_graph below.

n (number of nodes)
The starting graph is the n-cycle with nodes 1,...,n. (The null graph is returned if n < 0.)

shift_list = [s1,s2,..,sk], a list of integer shifts mod n,

repeats
integer specifying the number of times that shifts in shift_list are successively applied to each v_current in the n-cycle to generate an edge between v_current and v_current+shift mod n.

For v1 cycling through the n-cycle a total of k*repeats with shift cycling through shiftlist repeats times connect v1 with v1+shift mod n

The utility graph K_{3,3}

>>> G=LCF_graph(6,[3,-3],3)

The Heawood graph

>>> G=LCF_graph(14,[5,-5],7)

See http://mathworld.wolfram.com/LCFNotation.html for a description and references.

make_small_graph(graph_description, create_using=None, **kwds)

Return the small graph described by graph_description and kwds.

graph_description is a list of the form [type,name,n,xlist]

Here type is one of "adjacencylist" or "edgelist", name is the name of the graph and n the number of nodes. This constructs a graph of n nodes with integer labels 1,..,n.

If type="adjacencylist" then xlist is an adjacency list with exactly n entries, in with the j'th entry (which can be empty) specifies the nodes connected to vertex j. e.g. the "square" graph C_4 can be obtained by

>>> G=make_small_graph(["adjacencylist","C_4",4,[[2,4],[1,3],[2,4],[1,3]]])

or, since we do not need to add edges twice,

>>> G=make_small_graph(["adjacencylist","C_4",4,[[2,4],[3],[4],[]]])

If type="edgelist" then xlist is an edge list written as [[v1,w2],[v2,w2],...,[vk,wk]], where vj and wj integers in the range 1,..,n e.g. the "square" graph C_4 can be obtained by

>>> G=make_small_graph(["edgelist","C_4",4,[[1,2],[3,4],[2,3],[4,1]]])

Other graph descriptors can be passed to Graph() using kwds

moebius_kantor_graph()

Return the Moebius-Kantor Graph.

octahedral_graph()

Return the Platonic Octahedral Graph.

pappus_graph()

Return the Pappus Graph.

petersen_graph()

Return the Petersen Graph.

sedgewick_maze_graph()

Return a small maze with a cycle.

This is the maze used in Sedgewick,3rd Edition, Part 5, Graph Algorithms, Chapter 18, e.g. Figure 18.2 and following. Nodes are numbered 0,..,7

tetrahedral_graph()

Return the 3-regular Platonic Tetrahedral graph.

truncated_cube_graph()

Return the skeleton of the truncated cube.

truncated_tetrahedron_graph()

Return the skeleton of the truncated Platonic Tetrahedral Graph.

tutte_graph()

Return the Tutte Graph.


Variable Details

__author__

Type:
str
Value:
'''Aric Hagberg (hagberg@lanl.gov)
Pieter Swart (swart@lanl.gov)'''                                       

__credits__

Type:
str
Value:
''                                                                     

__date__

Type:
str
Value:
'$Date: 2005/04/10 04:52:35 $'                                         

__revision__

Type:
str
Value:
'$Revision: 1.24 $'                                                    

Generated by Epydoc 2.1 on Mon Apr 11 10:59:20 2005 http://epydoc.sf.net