Skip to main content

Implement of Depth First Search for a graph

Project description

Overview

PyGraph_DFS is a Python package that provides a straightforward and efficient way to perform Depth-First Search (DFS) on a graph. It is a versatile tool that can be used in various scenarios where graph traversal and exploration are necessary.

Installation

You can install PyGraph_DFS using pip:

pip install PyGraph_DFS

Usage

After installing the package, you can use it in your Python scripts as follows:

from PyGraph_DFS import GraphDFS

# Create a graph instance
my_graph = GraphDFS()

# Add edges to the graph
my_graph.add_edge("A", "B")
my_graph.add_edge("B", "C")
my_graph.add_edge("B", "D")
my_graph.add_edge("D", "E")

# Perform Depth-First Search (DFS)
visited_nodes = my_graph.dfs("A")

# Print the visited nodes
print(visited_nodes)

Example Output

The above code will produce the following output:

['A', 'B', 'C', 'D', 'E']

License

This project is licensed under the MIT License. See the LICENSE.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyGraph_DFS-0.1.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PyGraph_DFS-0.1-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file PyGraph_DFS-0.1.tar.gz.

File metadata

  • Download URL: PyGraph_DFS-0.1.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.5

File hashes

Hashes for PyGraph_DFS-0.1.tar.gz
Algorithm Hash digest
SHA256 b271d82ba3f0d9970ab7b237cba9e3ae8f2810f41128b37af6f63ed7dd70f365
MD5 6cc065086ac1883919c56b0b7ab31cb1
BLAKE2b-256 3c1210be2ce0fff403e3b9da4554da561f06b263c88d96d5ac2ad0a1cdfc0bb0

See more details on using hashes here.

File details

Details for the file PyGraph_DFS-0.1-py3-none-any.whl.

File metadata

  • Download URL: PyGraph_DFS-0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.5

File hashes

Hashes for PyGraph_DFS-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7f5e99a085bf53d3ada52b6fafa7098f414246b45133faf418ac7d86539c8bb3
MD5 28db55677f9ecf700025186f07c87bde
BLAKE2b-256 8db782e2c65bc61ebc78cafe6a12d2101a007d0beac69442aa2edc919738d8b5

See more details on using hashes here.

Supported by

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