Graph algorithms library for educational purposes
Project description
import numpy as np from graphalgos.graph.adjacency import AdjacencyMatrix from graphalgos.algorithms.hamiltonian import HamiltonianSolver from graphalgos.algorithms.floyd_warshall import FloydWarshall
Создание графа
adj_matrix = np.array([ [0, 1, 0, 1, 0], [1, 0, 1, 1, 1], [0, 1, 0, 0, 1], [1, 1, 0, 0, 1], [0, 1, 1, 1, 0] ])
Поиск Гамильтонова цикла
solver = HamiltonianSolver() cycle = solver.backtracking_hamiltonian(adj_matrix) print(f"Гамильтонов цикл: {cycle}")
Поиск кратчайших путей
dist, next_hop = FloydWarshall.floyd_warshall(adj_matrix) print(f"Матрица расстояний:\n{dist}")
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file graphalgos-0.1.0.tar.gz.
File metadata
- Download URL: graphalgos-0.1.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf81a102406cf1785744540f6fe3d36f0ed5d5fa8f39632c956eb62fde094399
|
|
| MD5 |
3eed5808637cf19c1bef3966dadd97a5
|
|
| BLAKE2b-256 |
1195fae5612d18cd7000ee562ac28615ae421d363748b0b87a7149283642e60d
|
File details
Details for the file graphalgos-0.1.0-py3-none-any.whl.
File metadata
- Download URL: graphalgos-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc1aa164e55aeab230704d7855fe5c765e59402468cc0df5787074f5e4044e9b
|
|
| MD5 |
5fc4e53ee1ca805ab0a0fb49a7eede68
|
|
| BLAKE2b-256 |
40f6aa034e2835f4a536395d55c42c80fe41d73dc8416a784bbcc5788b80afdc
|