bitwalker / libgraph

A graph data structure library for Elixir projects
MIT License
524 stars 75 forks source link

Use ID as vertex label when generating DOT output #45

Closed rlipscombe closed 2 years ago

rlipscombe commented 2 years ago

If you have vertices with the same label, the DOT output treats them as the same vertex.

Use the raw ID to ensure that vertices aren't merged.

rlipscombe commented 2 years ago

Probably doesn't play nice with the change in https://github.com/bitwalker/libgraph/issues/44

bitwalker commented 2 years ago

I haven't tested with an example file yet, but does this preserve readability of the output (i.e. do you still see the vertex label for each vertex?). If you serialize a graph and all you see are random ids, I imagine that's not super useful. Assuming that isn't the case, looks good to me otherwise!

rlipscombe commented 2 years ago

It uses [label=#{v_label}] to preserve the labels. I can't guarantee that I've not broken something else, though.