Find All Possible Paths from a Single SourceNode to a Single TargetNode Without Visiting Old Paths
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi All,
If I have node set nodeset=[nodeID x y] of size numberOfNodes x 3. I also have undirected path pathset=[PathID nodeID1 nodeID2] of size PathID x 3. I would like to find all possible paths from a single sourceNode to a single TargetNode. Visiting the previously travelled edge (path) is not allowed because there would be too much solutions. Visiting the previously travelled vertices are allowed.
Is there a function out there in Matlab that can help me do this: Example: AllPaths(nodeset, pathset, sourceNode, TargetNode) output: sets of vector containing PathID's that gives those possible path.
Your help much appreciated. Thank you in advance.
2 comentarios
Walter Roberson
el 29 de En. de 2018
On undirected graphs, there are an infinite number of paths between any two nodes that are connected indirectly at all.
Someone asked a similar question a couple of months ago; they were trying to investigate centrality of social networks. I was not able to come up with an algorithm which did not come down to breadth-first search or depth-first search.
Steven Lord
el 29 de En. de 2018
If like the person Walter remembers who asked the similar question a couple months ago you're trying to investigate centrality of a graph or digraph, take a look at the centrality function.
Respuestas (1)
Ver también
Categorías
Más información sobre Graph and Network Algorithms en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!