ITensor / NamedGraphs.jl

Extension of `Graphs.jl` to graphs with named vertices.
MIT License
6 stars 3 forks source link

Return hash map/set for vertices #56

Closed mtfishman closed 6 months ago

mtfishman commented 6 months ago

A downside of this is that the output of vertices(g::NamedGraph) no longer has a well-defined ordering corresponding to the memory ordering of the vertices of the parent graph, and instead should be treated as, and now outputs, a set. However, an upshot is that vertex lookup is faster (O(1) instead of O(nv(g))), and user code shouldn't rely on vertex ordering anyway so I think it forces better code style.