Skip to content

DimitriChrysafis/HamiltonianPath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hamiltonian Path Finder

Sample image

This Python project is designed to find Hamiltonian paths and cycles in a given graph. The initial adjacency matrix for the graph is provided below:

adjacency_matrix = [
    [0, 1, 1, 0, 0, 0, 0, 1, 0, 0],
    [1, 0, 1, 1, 0, 0, 0, 0, 0, 0],
    [1, 1, 0, 0, 1, 0, 1, 0, 0, 1],
    [0, 1, 0, 0, 1, 0, 0, 0, 0, 0],
    [0, 0, 1, 1, 0, 1, 1, 0, 0, 0],
    [0, 0, 0, 0, 1, 0, 1, 0, 0, 0],
    [0, 0, 0, 0, 1, 1, 0, 0, 0, 1],
    [1, 0, 0, 0, 0, 0, 0, 0, 1, 1],
    [0, 0, 0, 0, 0, 0, 0, 1, 0, 1],
    [0, 0, 1, 0, 0, 0, 1, 1, 1, 0]
]

ham.py

The ham.py file contains the initial adjacency matrix of the graph. It uses NetworkX to work with graphs.

graph.py

The graph.py file generates a graphical representation of the given graph and displays it.

deg.py

The deg.py file calculates the degrees of vertices in the graph.

About

Graph theory and discrete math playground for hamiltonian paths and cycles (cool stuff )

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages