Skip to main content

Mine DAG

Mine realisation of DAG

Install

pip install minedag

Usage

Initialize

from minedag import MineDag

# create structure
dag = MineDag()

# add nodes
dag.add_node(1)
dag.add_node(2)
dag.add_node(3)
dag.add_node(4)

# add edges
dag.add_edge(1, 2, weight=1)
dag.add_edge(1, 3, weight=2)
dag.add_edge(2, 4, weight=3)
dag.add_edge(3, 4, weight=4)

Use methods (not all presented here, for more read the sources):

dag.get_all_roots()  # {1}
dag.get_leaves()  # {4}

dag.get_all_srcs(2)  # {1}
dag.get_all_dsts(2)  # {4}

dag.get_layer_iterations({1}) # [{1}, {2, 3}, {4}]

dag.find_longest_way_to_any_leaf(1)  # 4, [2, 4] - (weight, path) 

Metadata

Release files for minedag 1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for minedag 1.3
File Interpreter ABI Platform
minedag-1.3-py2.py3-none-any.whl Python 2, Python 3 none any Details

Release files / minedag-1.3-py2.py3-none-any.whl

Download URL minedag-1.3-py2.py3-none-any.whl
Size 5.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
05288430e7de22745973df72dc7b8ce381238bc87836da961284d47e7c0d70e7
BLAKE2b-256 checksum
How to use checksums
27c4ee9b0461ab1f77dc21f7357ae6fb4f5eab9cbde1d842fdcaa48ad80125e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.14

Release history Release notifications | RSS feed

This release

1.3 This release

1 release file

1.2.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page