Socket
Book a DemoInstallSign in
Socket

graph-dfs

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graph-dfs

Graphs and Depth First Search

0.0.8
pipPyPI
Maintainers
1

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()

Keywords

graph

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.