Skip to main content

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

graph-dfs-0.0.1.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

graph_dfs-0.0.1-py3-none-any.whl (2.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page