# Mine DAG
Mine realisation of DAG
# Install
```bash
pip install minedag
```
# Usage
Initialize
```python
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):
```python
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)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/moff4/minedag",
"name": "minedag",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Komissarov Andrey",
"author_email": "Komissar.off.andrey@gmail.com",
"download_url": null,
"platform": null,
"description": "# Mine DAG\nMine realisation of DAG\n\n\n# Install\n\n```bash\npip install minedag\n```\n\n# Usage\n\nInitialize\n\n```python\nfrom minedag import MineDag\n\n# create structure\ndag = MineDag()\n\n# add nodes\ndag.add_node(1)\ndag.add_node(2)\ndag.add_node(3)\ndag.add_node(4)\n\n# add edges\ndag.add_edge(1, 2, weight=1)\ndag.add_edge(1, 3, weight=2)\ndag.add_edge(2, 4, weight=3)\ndag.add_edge(3, 4, weight=4)\n\n```\n\nUse methods (not all presented here, for more read the sources):\n```python\n\ndag.get_all_roots() # {1}\ndag.get_leaves() # {4}\n\ndag.get_all_srcs(2) # {1}\ndag.get_all_dsts(2) # {4}\n\ndag.get_layer_iterations({1}) # [{1}, {2, 3}, {4}]\n\ndag.find_longest_way_to_any_leaf(1) # 4, [2, 4] - (weight, path) \n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Mine realisation of DAG",
"version": "1.3",
"project_urls": {
"Homepage": "https://github.com/moff4/minedag"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "27c4ee9b0461ab1f77dc21f7357ae6fb4f5eab9cbde1d842fdcaa48ad80125e4",
"md5": "2bdd47c32fb29142acd1e0da8532f970",
"sha256": "05288430e7de22745973df72dc7b8ce381238bc87836da961284d47e7c0d70e7"
},
"downloads": -1,
"filename": "minedag-1.3-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "2bdd47c32fb29142acd1e0da8532f970",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 5888,
"upload_time": "2024-09-03T12:11:40",
"upload_time_iso_8601": "2024-09-03T12:11:40.860116Z",
"url": "https://files.pythonhosted.org/packages/27/c4/ee9b0461ab1f77dc21f7357ae6fb4f5eab9cbde1d842fdcaa48ad80125e4/minedag-1.3-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-03 12:11:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "moff4",
"github_project": "minedag",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "minedag"
}