Skip to content

Update Graph to encode strictness behaviour #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

swapnilraj
Copy link
Contributor

Add a strict constructor to graph to encode strictness behaviour.
Implemented combinators to make it easy to migrate.

https://www.graphviz.org/doc/info/lang.html

@csicar
Copy link
Owner

csicar commented Apr 20, 2020

Sorry for taking so long.

I'm not sure, if I already asked, but is there a reason to have Strict over just adding one edge, instead of using strict to remove the additional edges?

What does concentrate do?

@swapnilraj
Copy link
Contributor Author

In my case, I am generating the edges instead of statically making the graph. Even though I could check in my code but I find it easier if graphviz handles it for me.

Irrespective of it, its just better for the library to have support for more graphviz attributers to encode.

Strict: This forbids the creation of multi-edges, i.e., there can be at most one edge with a given tail node and head node in the directed case.
Concentrate: merges multiedges into a single edge and causes partially parallel edges to share part of their paths

@csicar
Copy link
Owner

csicar commented Apr 21, 2020

I see, I guess that's a good reason ;)
The changes that concentrate introduce look good 👍

If you don't mind, I would move strict to the global directive. I know graphviz does it this way, but I find it a bit confusing. Why should strict be treated different when compared to e.g. rankdir?

Basically:

DiGraph [
    global [ strict ]
    ...
]

instead of

DiGraph Strict [
   ...
]

Also: Thanks for the contribution, always happy to get new ones :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants