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
On the host it appears to be impossible to easily iterate through all the edges on a directed graph. It would be really useful if this facility was available.
But to do that you need to already know the source and target vertices. Iterating without this prior knowledge would be very useful.
Describe the solution you'd like
Agent functions offer graph.getEdgeSource(index) in which index is a single number that easily allows you to move through all edges, but from the agent function you can't then update the directed graph environment variable. Having similar iteration capability to work through all edges on the host would be really useful.
Describe alternatives you've considered
My current solution is to perform the calculation in an agent function when needed, but this means repeated output is being generated that could otherwise have been calculated once for each edge and stored.
Additional context
Iterating over the edges without knowing source and target is useful (for example) when a directed graph has been read in from a JSON file. Taking the graph to represent the spatial position of a series of locations it's useful for an initialisation function to pre-calculate and store within the graph the length of each edge. That's better than storing in the JSON and needing to keep the length in sync with any change of the vertices.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem?
On the host it appears to be impossible to easily iterate through all the edges on a directed graph. It would be really useful if this facility was available.
Edges can be addressed using the format:
HostEnvironmentDirectedGraph::EdgeMap::Edge edge = edges[{i,j}];
But to do that you need to already know the source and target vertices. Iterating without this prior knowledge would be very useful.
Describe the solution you'd like
Agent functions offer graph.getEdgeSource(index) in which index is a single number that easily allows you to move through all edges, but from the agent function you can't then update the directed graph environment variable. Having similar iteration capability to work through all edges on the host would be really useful.
Describe alternatives you've considered
My current solution is to perform the calculation in an agent function when needed, but this means repeated output is being generated that could otherwise have been calculated once for each edge and stored.
Additional context
Iterating over the edges without knowing source and target is useful (for example) when a directed graph has been read in from a JSON file. Taking the graph to represent the spatial position of a series of locations it's useful for an initialisation function to pre-calculate and store within the graph the length of each edge. That's better than storing in the JSON and needing to keep the length in sync with any change of the vertices.
The text was updated successfully, but these errors were encountered: