Skip to main content

Graphs and Depth First Search

Project description

Graph-DFS

This package allows for the creation of graphs. It also provides the depth first search algorithm.

Installation

pip install graph-dfs

How to use it?

To create a graph, do:

g = Graph(n)

where n is the number of vertices. To create an arc from vertex a to vertex b, do:

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:

dfs = DFS(g)
dfs.start()

If you desire to obtain a topological sorting of the graph, then do so after a DFS with:

dfs.topological_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.8.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

graph_dfs-0.0.8-py3-none-any.whl (3.1 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