EasyGraphLib
This is a simple package for working with graphs in Python 3.
Tasks:
- Add weighted graph.
- Add unweighted graph.
- Add tree's.
"class weighted_graph" methods:
-
add_node("node name", "connect or connections", "values for con/con's") - This method create Node with connections, and Nodes for connections.
-
add_connections("node name", "connection or connections", "values for con/con's") - This method adding connections to Node, and create new Nodes for connections.
-
update_connection("node name", "connection", "value") - This method update weight for connection.
-
remove_node("node name") - Remove node with connections.
-
remove_connection("node name", "connection") - Remove connection from node.
-
compile_graph() - Compile EasyGraphLib struct.
-
find_tnw_d("EasyGraphLib struct") - Dijkstra algorythm.
import easygraphlib as egl wg = egl.weighted_graph() wg.add_node("start", ("a", "b"), (6,2)) wg.add_connections("start", ("c"), (3)) wg.add_connections("c", ("a", "fin"), (2, 2)) wg.add_connections("a", ("fin"), (3)) wg.add_connections("b", ("a", "fin"), (3, 5)) wg.update_connection("start", "c", (4)) wg.update_connection("a", ("fin"), (1)) input_graph = wg.compile_graph() print(input_graph)
"class unweighted_graph" methods:
-
add_node("node name", "value", "connections", "auto create node flag True/False") - This method create Node with connections, and Nodes for connections.
-
add_connections("node name", "connection or connections", "auto create node flag True/False") - This method adding connections to Node, and create new Nodes for connections.
-
update_value("node name", "value") - Update value for Node.
-
remove_node("node name") - Remove node with connections.
-
remove_connection("node name", "connection") - remove connection from node.
-
get_graph()
-
wide_search("node name", "value", "condition")
import easygraphlib as egl uwg = egl.unweighted_graph() uwg.add_node("me", False, ("Patrick", "Carry", "Josh")) uwg.add_node("Joseph", False, ("Lora")) uwg.add_connections("Patrick", ("Henry", "July", "me")) print(uwg.get_graph()) uwg.add_connections("me", ("Henry", "Harry")) uwg.add_connections("Patrick", "Henry") print(uwg.get_graph())
Release files for EasyGraphLib 0.3.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| EasyGraphLib-0.3.5.tar.gz | 4.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| EasyGraphLib-0.3.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.3 kB
Release files / EasyGraphLib-0.3.5.tar.gz
| Download URL | EasyGraphLib-0.3.5.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
78d7db90723d453a2ccae6bef83933b20de48fc75e76b55dc16d4f9ee46522c3
|
|
BLAKE2b-256 checksum How to use checksums |
5ccc68680aaec55c36577a5e75d4c288cd61cf2f5bbfe807d20d65d7baaa09a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5
|
Release files / EasyGraphLib-0.3.5-py3-none-any.whl
| Download URL | EasyGraphLib-0.3.5-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
184c7e72e15aa1341cca096b8339bac98d200da0aa0ec9bc3d20952b0606fe47
|
|
BLAKE2b-256 checksum How to use checksums |
2245137562f13a1f1a4e7ed6a791b90a7d32f697591de1e6ab7b2b26d2fdd5d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5
|