Open In App

Python NetworkX – Tutte Graph

It is a graph with 46 vertices and 69 edges. It is important because it is an exception to Tait’s conjecture which states that every 3-regular polyhedron has a Hamiltonian cycle. 

Tutte Graph

Properties of Tutte Graph:



Tutte Fragment

We will use the networkx module for realizing a Tutte graph. It comes with an inbuilt function networkx.tutte_graph() and can be illustrated using the networkx.draw() method.

Syntax:



networkx.draw(G, node_size, node_color)

Parameters:

  • G: It refers to the Tutte graph object
  • node_size: It refers to the size of nodes.
  • node_color: It refers to color of the nodes.

Below are some examples which depict how to illustrate a Tutte graph in Python:

Example 1:




# import required module
import networkx
 
# create object
G = networkx.tutte_graph()
 
# illustrate graph
networkx.draw(G)

 

 

Output:

 

 

Example 2:

 




# import required module
import networkx
 
# create object
G = networkx.tutte_graph()
 
# illustrate graph
networkx.draw(G, node_color='green')

Output:

Example 3:




# import required module
import networkx
 
# create object
G = networkx.tutte_graph()
 
# illustrate graph
networkx.draw(G, node_size=15,
              node_color='green')

Output:

Note: The shape of output graph illustration is generated randomly but the number, size and color of nodes will be according to the argument passed in networkx.draw() method.


Article Tags :