Skip to content
/ Petersen Public template

Python program that defines a class called Petersen representing the Petersen graph. The Petersen class has methods for calculating adjacent vertices for each vertex in the graph, printing them to console, and drawing the graph using the networkx and matplotlib libraries.

Notifications You must be signed in to change notification settings

iammrverma/Petersen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Petersen Graph

This program defines a class Petersen that represents the Petersen graph, which is a small, non-planar, symmetrically regular graph. It takes input from the user for the number of vertices and absolute difference between inner vertices, and then draws the graph using networkx and matplotlib.

Usage

To use this program, you will need Python 3.x and the following packages:

networkx

matplotlib

To install these packages, run the following command: pip install networkx matplotlib. To run the program, run the following command: python petersen.py

You will be prompted to enter the number of vertices and the absolute difference between inner vertices. The program will then draw the Petersen graph using networkx and matplotlib.

License

This program is licensed under the MIT License. See the LICENSE file for details.

Author

This program was created by Raj Verma on 17/02/2023.

About

Python program that defines a class called Petersen representing the Petersen graph. The Petersen class has methods for calculating adjacent vertices for each vertex in the graph, printing them to console, and drawing the graph using the networkx and matplotlib libraries.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages