-
Notifications
You must be signed in to change notification settings - Fork 80
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
Graphviz encodable #63
Comments
I started working on this as a separate project, independent of Swiftgraph. This way Swiftgraph ios not polluted and can be versioned separately. Also the encoder can work with other graph libraries. |
Great, what license are you going to be releasing it under? I may want to pull it into the mainline since it would add a lot of value. |
It's MIT license: https://github.com/ferranpujolcamins/DotSwift Of course you could also pull the whole project or part of it into SwiftGraph. But keeping them separated might be easier for versioning. |
I don't how to handle directed / undirected graphs. Graphviz let us choose how to draw each edge (see this link. But, when I add an undirected edge between vertices A and B, Swiftgraph adds a directed edge from A to B and a directed edge from B to A. When inspecting such a graph, shall we draw one undirected edge or two directed edges? We can't tell. |
Yeah that is an issue. I guess for importing it's not an issue but for exporting it is. You could check every time if there is an edge in both directions and if there is just do an undirected edge. It could be a configurable flag? |
I'm experimenting with an alternative representation of a Graph. Basically, the Edge object now has a directed property, to know if it's a directed edge or not. Each Edge object is stored only once in a new So now, when we add an undirected edge, we really add just one undirected edge, not two directed edges. So the graph does not lose information on whether edges are directed or not, as opposed to what happened before. Also, when a user adds an undirected edge, the edge count is 1, not 2, which is more intuitive. What are your thoughts on this? |
The approach above involved extensive changes to the codebase and resulted in a massive performance drop, so I discarded it. I thought of a much simpler solution with no performance impact in existing performance tests: #67 |
It would be great to add an encoder for the dot language of https://www.graphviz.org/
This way applications can export the graphs they build with SwiftGraph for human visualization.
The text was updated successfully, but these errors were encountered: