Module for creating graphs and performing depth first search.
Project description
# Graph-DFS
This package allows for the creation of graphs. It also provides the depth first search algorithm.
## How to use it?
To create a graph, do:
`python g = Graph(n) `
where n is the number of vertices. To create an arc from vertex a to vertex b, do:
`python g.link(a, b) `
where a and b are indices in the range [0, n - 1]. You can perform a depth first search on the graph with:
`python dfs = DFS(g) dfs.start() `
## Installation
`shell pip install graph-dfs `
If you desire to obtain a topological sorting of the graph, then do so after a DFS with:
`python dfs.opological_sorting() `
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for graph_dfs-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5ecc0249f11a31bafa8cbefd28cd66d7304e6ce6d647a46a13cc5e0e946de99 |
|
MD5 | 43000c7f90ff521820b7eaec27530714 |
|
BLAKE2b-256 | a16461b157d9c05792d96b36dd4f5cfcaddc1386e8468755788770d1186026c3 |