Package for Assignment4
Project description
URL for GitHub repository: https://github.com/kkruzel/graphs_kkruzel
The Dijkstra Algorithm works to find the shortest paths from a starting node to all other nodes in a weighted graph. The algorithm ensures that the shortest path to each node is found, considering the total weight of edges. It follows the following steps: 1. It initializes an array's values to each node's distance to the starting node to infinity (except for the starting node which is 0). Infinity is represented by sys.maxsize. 2. The algorithm repeatedly selects the node with the smallest known distance (starting with the starting node). For each neighbor of the current node, it calculates the distance from the source by adding the distance to the current node and the edge weight to the neighbor. 3. If the new calculated distance to a neighbor is smaller than the previously recorded distance, update the neighbor's distance and add it to the priority queue. 4. This process continues until all nodes have been visited and the queue is empty. The result the algorithm provides is the shortest distance to each node from the starting node and the path to reach each node.
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file graphs_kkruzel-0.0.1.tar.gz
.
File metadata
- Download URL: graphs_kkruzel-0.0.1.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0413d01569a4cec078e30db6e15f2c7334fde638cd3a221b51c70e3fa36c8af |
|
MD5 | c03e1d6b9bba61d95c1b7e05804b8f96 |
|
BLAKE2b-256 | e9f25de4e749bbe05feaa493200812825276d4a90ef195873c298e032fd5e608 |
File details
Details for the file graphs_kkruzel-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: graphs_kkruzel-0.0.1-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee680b3956be0eaf6171becf9dbb9f5538f45b6790beea4dd8b9017b23599065 |
|
MD5 | f08a6d7d43ec973e8602f66a6d140f83 |
|
BLAKE2b-256 | b71daa2d9280d82e1accc5051d9698d0f563f0189cf18ebb9ded3b9d0baebe31 |