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
I want to iterate through the vertices of a graph, but the graph type does not have that method, and visiting each one using DFS does not work since, during runtime, I have vertices with no edges connected.
Even if I had, I could only iterate through edges and then access Vertices, using the method Edges() of the graph, but that will not make me go through a vertice only once. Is there any way I can get a slice of them like the method that exists in type Store ListVertices()?
The text was updated successfully, but these errors were encountered:
adjacencyMap, _:=g.AdjacencyMap()
forvertex:=rangeadjacencyMap {
// Do something with vertex.
}
The adjacency map is guaranteed to contain all vertices in the graph. If you want them as a slice, you can build it yourself – but it is likely that there will be a Vertices method in the future.
I want to iterate through the vertices of a graph, but the graph type does not have that method, and visiting each one using DFS does not work since, during runtime, I have vertices with no edges connected.
Even if I had, I could only iterate through edges and then access Vertices, using the method Edges() of the graph, but that will not make me go through a vertice only once. Is there any way I can get a slice of them like the method that exists in type Store ListVertices()?
The text was updated successfully, but these errors were encountered: