You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to export these into NamedGraphs.jl? I can then fork and add a function which creates a subgraph of a NamedDimGraph containing only the vertices within a certain pathlength of a source_vertex. Such a function could then be utilised in ITensorNetworks.jl to orthogonalise a network up to some distance r from a source_vertex.
The text was updated successfully, but these errors were encountered:
Good question. That is the goal, however some functions in Graphs.jl don't handle general vertex types so don't automatically work. More specifically, many Graphs.jl functions assume the vertices are integers from 1 to nv(graph) and make use of that in their implementations and type signatures, like you are seeing in the error message above. If you hit on Graphs.jl functions that don't work for NamedGraphs.jl types, please raise an issue about it, and in fact we should keep track of a list of functions that need to be wrapped properly by NamedGraphs.jl.
In general it is pretty easy to add wrappers, which mostly involve calling the Graphs.jl function on the parent graph which you can extract with parent_graph(named_graph), and then possibly converting back and forth between named vertices and integer vertices of the parent graph using vertex_to_parent_vertex(named_graph, vertex) and parent_vertex_to_vertex(graph, parent_vertex)
I was trying to use some shortest path algorithms from Graphs.jl on NamedDimGraphs, e.g:
Using some of the traversal algorithms defined here: https://juliagraphs.org/Graphs.jl/dev/algorithms/shortestpaths/#Graphs.johnson_shortest_paths-Union{Tuple{AbstractGraph{U}},%20Tuple{T},%20Tuple{U},%20Tuple{AbstractGraph{U},%20AbstractMatrix{T}}}%20where%20{U%3C:Integer,%20T%3C:Real}
Is it possible to export these into NamedGraphs.jl? I can then fork and add a function which creates a subgraph of a NamedDimGraph containing only the vertices within a certain pathlength of a source_vertex. Such a function could then be utilised in ITensorNetworks.jl to orthogonalise a network up to some distance r from a source_vertex.
The text was updated successfully, but these errors were encountered: