sepandhaghighi / pyrgg

🔧 Python Random Graph Generator
https://www.pyrgg.site
MIT License
203 stars 29 forks source link

Directed graph generation failed for yaml format #93

Open metiroozmeh opened 3 years ago

metiroozmeh commented 3 years ago

Description

The generated graph in yaml format is not a DAG graph, however, during configuration phase directed option is chosen. Please let me know if there is a solution to this issue. Please have a look at the generated file using the link below :

https://drive.google.com/file/d/1o2WODs34h2pwAeOgItcmTgjxT6mA0zjD/view?usp=sharing

You can find the loop in these nodes: [[4, 7, 10], [1, 5, 9]]

Expected Behavior

Directed acyclic graph

Actual Behavior

Looped graph

Operating System

Linux

Python Version

PYthon 3.7.5

Pyrgg Version

V1.0

sepandhaghighi commented 3 years ago

@metiroozmeh Thanks for your comment 💯 The graph you mentioned above can be directed but is not acyclic. Unfortunately, in this version of pyrgg there is no option to control cycles! We will add this option in a future release. Please, feel free to let me know if you require any further information.

metiroozmeh commented 3 years ago

@sepandhaghighi Thank you for your quick reply and well-organized repository. I missed the point that the graphs are directed but cyclic since I am looking for DAG generator in C/C++ or python preferably. Do you have any suggestion ? Hopefully the next pyrgg version will be equipped with this feature which to me is more than essential .

sepandhaghighi commented 3 years ago

@sepandhaghighi Thank you for your quick reply and well-organized repository. I missed the point that the graphs are directed but cyclic since I am looking for DAG generator in C/C++ or python preferably. Do you have any suggestion ? Hopefully the next pyrgg version will be equipped with this feature which to me is more than essential .

@metiroozmeh 🙏🙏

  1. I'm not sure, but take a look at networkx
  2. If you need some small~medium graphs, you can use pyrgg version 1.0 and remove cycles manually

You are completely right, this option is necessary and I plan to add it in the next few weeks (probably version 1.2). If you like this project, you can support it by giving us a ⭐️