DHART
Loading...
Searching...
No Matches
DHARTAPI.Pathfinding.ShortestPath Class Reference

Functions for finding the shortest path between two nodes in a graph. More...

Static Public Member Functions

static Path DijkstraShortestPath (Graph graph, int start_id, int end_id, string cost_type="")
 Perform Dijkstra's shortest path algorithm to find a path between two nodes. More...
 
static Path DijkstraShortestPath (Graph graph, Vector3D start_node, Vector3D end_node, string cost_type="")
 Perform Dijkstra's shortest path algorithm to find a path between two nodes. More...
 
static Path[] DijkstraShortestPathMulti (Graph graph, int[] start_ids, int[] end_ids, string cost_type="")
 Find the shortest paths between each pair of start_id and end_id in order. More...
 
static Path[] DijkstraShortestPathMulti (Graph graph, IEnumerable< Vector3D > start_nodes, IEnumerable< Vector3D > end_nodes, string cost_type="")
 Find the shortest paths between each pair of start_id and end_id in order. More...
 
static Path[] DijkstraAllToAll (Graph g, string cost_type="")
 Generate a path from every node in the graph to every other node in a graph. More...
 
static void GeneratePredecessorAndDistanceMatricies (Graph g, out UnmanagedFloatArray2D out_dist, out UnmanagedIntArray2D out_predecessor, string cost_type="")
 Calculate Predecessor and Distance Matricies for a graph. More...
 

Detailed Description

Functions for finding the shortest path between two nodes in a graph.

Remarks
The shortest path functions will use Dijkstra's algorithm to find the shortest path between one or more nodes in a Graph. Since the graph can hold multiple costs for each contained edge, the type of cost used in this calculation can be specified for each function. This allows for paths to be generated using costs generated by the CostAlgorithms in SpatialStructures such as cross slope, or energy expenditure.
See also
ShortestPath for generating a single path between two nodes.
DijkstraShortestPath for generating multiple paths at once.
SpatialStructures.Graph for more information on how it stores multiple costs.

Member Function Documentation

◆ DijkstraAllToAll()

static Path[] DHARTAPI.Pathfinding.ShortestPath.DijkstraAllToAll ( Graph  g,
string  cost_type = "" 
)
static

Generate a path from every node in the graph to every other node in a graph.

Parameters
gThe graph to generate paths in.
cost_typeType of cost to use for path generation. If left blank will use the default cost of the graph
Returns
An array of paths with a length equal to the number of nodes in g squared. Paths will be returned in order starting with all paths from node 0, then all paths from node 1, etc. If a path could not be generated between a set of nodes, then path at that index will be null.
Precondition
If cost_type is not left as the default, then it must be the name of a valid cost already defined in graph.
Exceptions
KeyNotFoundExceptioncost_type wasn't left as blank, and didn't refer to the name of any cost that already exists in graph.
Example
// Create a graph and add some edges
Graph g = new Graph();
// Create nodes and add edges to the graph
Vector3D[] Nodes =
{
new Vector3D(0,0,1),
new Vector3D(0,0,2),
new Vector3D(0,0,3),
new Vector3D(0,0,4)
};
g.AddEdge(Nodes[0], Nodes[1], 10);
g.AddEdge(Nodes[0], Nodes[2], 30);
g.AddEdge(Nodes[0], Nodes[3], 30);
g.AddEdge(Nodes[1], Nodes[2], 15);
g.AddEdge(Nodes[3], Nodes[1], 15);
g.AddEdge(Nodes[2], Nodes[3], 5);
// Compress the graph
g.CompressToCSR();
// Generate all paths for this graph
string output = "";
// Iterate through the return values to print the path from every node to every other node
int num_nodes = g.NumNodes();
for (int start_id = 0; start_id < num_nodes; start_id++)
{
for (int end_id = 0; end_id < num_nodes; end_id++)
{
// If this is a node to itself then continue
if (start_id == end_id) continue;
// get the path from parent id to child id
int path_index = (start_id * num_nodes) + end_id;
Path start_to_end = paths[path_index];
// Only print the path if it was able to be found
if (start_to_end != null)
output += String.Format("{0} -> {1} : {2}", start_id, end_id, start_to_end) + "\n";
else
output += String.Format("{0} -> {1} : {2}", start_id, end_id, "[None]") + "\n";
}
}
// Print output
Debug.WriteLine(output);
A collection of PathMembers representing a path from a start point to an end point.
Definition: Path.cs:53
Functions for finding the shortest path between two nodes in a graph.
Definition: ShortestPath.cs:49
static Path[] DijkstraAllToAll(Graph g, string cost_type="")
Generate a path from every node in the graph to every other node in a graph.
Definition: ShortestPath.cs:336
A graph representing connections between points in space.
Definition: Graph.cs:112
A three dimensional vector with built in utility functions.
Definition: CommonTypes.cs:40
0 -> 1 : [(0, 10), (1, 0)]
0 -> 2 : [(0, 10), (1, 15), (2, 0)]
0 -> 3 : [(0, 30), (3, 0)]
1 -> 0 : [None]
1 -> 2 : [(1, 15), (2, 0)]
1 -> 3 : [(1, 15), (2, 5), (3, 0)]
2 -> 0 : [None]
2 -> 1 : [(2, 5), (3, 15), (1, 0)]
2 -> 3 : [(2, 5), (3, 0)]
3 -> 0 : [None]
3 -> 1 : [(3, 15), (1, 0)]
3 -> 2 : [(3, 15), (1, 15), (2, 0)]

References DHARTAPI.SpatialStructures.Graph.NumNodes().

◆ DijkstraShortestPath() [1/2]

static Path DHARTAPI.Pathfinding.ShortestPath.DijkstraShortestPath ( Graph  graph,
int  start_id,
int  end_id,
string  cost_type = "" 
)
static

Perform Dijkstra's shortest path algorithm to find a path between two nodes.

Parameters
graphThe graph to conduct the search on.
start_idThe ID of the node to start at.
end_idThe ID of the node to find a path to.
cost_typeThe type of cost to use for generating the path. If left blank, will use the cost that the graph was created with. In the case of the graph generator, the default cost is distance.
Returns
The shortest path from start_node to end_node or null if no path could be found.
Precondition
1) start_id and end_id must be the X,Y,Z position of nodes that already exist in graph.
2) If cost_type is not left as the default, then it must be the name of a valid cost already defined in graph.
Exceptions
KeyNotFoundExceptioncost_type wasn't left as blank, and didn't refer to the name of any cost that already exists in the graph.
See also
DijkstraShortestPathMulti for efficently generating multiple paths in parallel.
Example
// Load the OBJ from ddisk
var blob = OBJLoader.LoadOBJ("ExampleModels/energy_blob_zup.obj");
// Generate a BVH from it
EmbreeBVH bvh = new EmbreeBVH(blob, true);
// Setup graph variables
Vector3D start_point = new Vector3D(-30, 0, 20);
Vector3D spacing = new Vector3D(1, 1, 10);
int max_nodes = 10000;
float up_step = 5.0f;
float down_step = 5.0f;
float up_slope = 60.0f;
float down_slope = 60.0f;
int max_step_connections = 1;
int min_connections = 1;
// Generate a graph
bvh,
start_point,
spacing,
max_nodes,
up_step,
down_step,
up_slope,
down_slope,
max_step_connections,
min_connections,
-1
);
// Compress the graph so we can use it with pathfinding
graph.CompressToCSR();
// Calculate an alternate set of costs for the graph based on Energy Expenditure
Generate a graph of accessible space on a mesh.
Definition: GraphGenerator.cs:45
static Graph GenerateGraph(EmbreeBVH bvh, Vector3D start_point, Vector3D spacing, int max_nodes=-1, float up_step=0.2f, float up_slope=20, float down_step=0.2f, float down_slope=20, int max_step_connections=1, int min_connections=1, int core_count=-1, int[] obstacle_ids=null, int[] walkable_ids=null)
Generate a graph of accessible space with the given settings. If no graph can be generated,...
Definition: GraphGenerator.cs:101
Several cost algorithms that generate alternate costs for edges in a Graph.
Definition: Graph.cs:587
static void CalculateAndStoreEnergyExpenditure(Graph g)
Calculate the energy expenditure for every edge in a graph and store it as a new cost type within the...
Generate a graph of accessible space from a given start point.
Definition: GraphGenerator.cs:36
Automated analysis of the built environent
Definition: CommonTypes.cs:9
// Predeclare paths
Path energy_path, distance_path;
// Get the unique key of this cost type. We'll use this to tell the pathfinder to generate
// a path using the cost set that we just generated.
Contains names for the costs of the cost algorithms in the CostAlgrorithms namespace.
Definition: Graph.cs:51
static string ENERGY_EXPENDITURE
The key for the cost set generated by CostAlgorithms.GenerateAndStoreEnergyExpenditure()
Definition: Graph.cs:53
// Generate a graph using the alternate cost type, then generate one using the graph's
// default cost type, distance.
int start_id = 1;
int end_id = 105;
energy_path = ShortestPath.DijkstraShortestPath(graph, start_id, end_id, energy_key);
distance_path = ShortestPath.DijkstraShortestPath(graph, start_id, end_id);
static Path DijkstraShortestPath(Graph graph, int start_id, int end_id, string cost_type="")
Perform Dijkstra's shortest path algorithm to find a path between two nodes.
Definition: ShortestPath.cs:83
// Print paths to output.
Debug.WriteLine(distance_path);
Debug.WriteLine(energy_path);
[(1, 1.415028), (12, 1.417536), (26, 1.417887), (39, 1.418485), (50, 1.000265), (63, 1.000128), (80, 1.000098), (105, 0)]
[(1, 4.559175), (12, 5.759251), (26, 5.889585), (39, 6.100943), (50, 2.978094), (63, 2.826927), (80, 2.784634), (105, 0)]

Referenced by DHARTAPI.Pathfinding.ShortestPath.DijkstraShortestPath(), and StringToEdgeCost.Main().

◆ DijkstraShortestPath() [2/2]

static Path DHARTAPI.Pathfinding.ShortestPath.DijkstraShortestPath ( Graph  graph,
Vector3D  start_node,
Vector3D  end_node,
string  cost_type = "" 
)
static

Perform Dijkstra's shortest path algorithm to find a path between two nodes.

Parameters
graphThe graph to conduct the search on.
start_nodeThe X,Y,Z of a node in the graph node to start at.
end_nodeThe X,Y,Z of a node in the graph node to end at.
cost_typeThe type of cost to use for generating the path. If left blank, will use the cost that the graph was created with. In the case of the graph generator, the default cost is distance.
Returns
The shortest path from start_node to end_node or null if no path could be found.
Precondition
1) start_node and end_node must be the X,Y,Z position of nodes that already exist in graph.
2) If cost_type is not left as the default, then it must be the name of a valid cost already defined in graph.
Remarks
Gets the start id and end of both nodes, then calls the ID overload.
Exceptions
KeyNotFoundExceptioncost_type wasn't left as blank, and didn't refer to the name of any cost that already exists in the graph.
See also
DijkstraShortestPathMulti for efficently generating multiple paths in parallel.
Example
// Load the OBJ from ddisk
var blob = OBJLoader.LoadOBJ("ExampleModels/energy_blob_zup.obj");
// Generate a BVH from it
EmbreeBVH bvh = new EmbreeBVH(blob, true);
// Setup graph variables
Vector3D start_point = new Vector3D(-30, 0, 20);
Vector3D spacing = new Vector3D(1, 1, 10);
int max_nodes = 10000;
float up_step = 5.0f;
float down_step = 5.0f;
float up_slope = 60.0f;
float down_slope = 60.0f;
int max_step_connections = 1;
int min_connections = 1;
// Generate a graph
bvh,
start_point,
spacing,
max_nodes,
up_step,
down_step,
up_slope,
down_slope,
max_step_connections,
min_connections,
-1
);
// Compress the graph so we can use it with pathfinding
graph.CompressToCSR();
// Calculate an alternate set of costs for the graph based on Energy Expenditure
// Predeclare paths
Path energy_path, distance_path;
// Get the unique key of this cost type. We'll use this to tell the pathfinder to generate
// a path using the cost set that we just generated.
// Get the nodes from the graph
var nodes = graph.getNodes();
// Convert these to Vector3D for use in pathfinding
var start_node = nodes[1].ToVector3D();
var end_node = nodes[105].ToVector3D();
// Generate paths using these nodes.
energy_path = ShortestPath.DijkstraShortestPath(graph, start_node, end_node, energy_key);
distance_path = ShortestPath.DijkstraShortestPath(graph, end_node, start_node);
// Print paths to output.
Debug.WriteLine(distance_path);
Debug.WriteLine(energy_path);
[(1, 1.415028), (12, 1.417536), (26, 1.417887), (39, 1.418485), (50, 1.000265), (63, 1.000128), (80, 1.000098), (105, 0)]
[(1, 4.559175), (12, 5.759251), (26, 5.889585), (39, 6.100943), (50, 2.978094), (63, 2.826927), (80, 2.784634), (105, 0)]

References DHARTAPI.Pathfinding.ShortestPath.DijkstraShortestPath(), and DHARTAPI.SpatialStructures.Graph.GetNodeID().

◆ DijkstraShortestPathMulti() [1/2]

static Path[] DHARTAPI.Pathfinding.ShortestPath.DijkstraShortestPathMulti ( Graph  graph,
IEnumerable< Vector3D start_nodes,
IEnumerable< Vector3D end_nodes,
string  cost_type = "" 
)
static

Find the shortest paths between each pair of start_id and end_id in order.

Parameters
graphThe graph to generate paths in.
start_nodesLocations of the start points to generate paths from.
end_nodesLocations of the end nodes to generate paths to.
cost_typeThe type of cost to use for generating the path. If left blank, will use the cost that the graph was created with. In the case of the graph generator, the default cost is distance.
Returns
A list of paths in order from start_ids to end_ids. If a path could not be generated by a set of points, then the path at that location will be null.

Determines the IDs of nodes, then calls the other overload. Uses all available cores for parallel calculation.

Precondition
1) The length of start_ids must match the length of end_ids.
2) Each node in start_nodes and end_nodes must contain the x,y,z position of an existing node in graph
3) If cost_type is not left as the default, then it must be the name of a valid cost already defined in graph.
Exceptions
System.ArgumentExceptionLength of start_ids didn't equal length of end_ids
KeyNotFoundExceptioncost_type wasn't left as blank, and didn't refer to the name of any cost that already exists in graph.
Example
// Load the OBJ from ddisk
var blob = OBJLoader.LoadOBJ("ExampleModels/energy_blob_zup.obj");
// Generate a BVH from it
EmbreeBVH bvh = new EmbreeBVH(blob, true);
// Setup graph variables
Vector3D start_point = new Vector3D(-30, 0, 20);
Vector3D spacing = new Vector3D(1, 1, 10);
int max_nodes = 10000;
float up_step = 5.0f;
float down_step = 5.0f;
float up_slope = 60.0f;
float down_slope = 60.0f;
int max_step_connections = 1;
int min_connections = 1;
// Generate a graph
bvh,
start_point,
spacing,
max_nodes,
up_step,
down_step,
up_slope,
down_slope,
max_step_connections,
min_connections,
-1
);
// Compress the graph so we can use it with pathfinding
graph.CompressToCSR();
// Calculate an alternate set of costs for the graph based on Energy Expenditure
// Get the unique key of this cost type. We'll use this to tell the pathfinder to generate
// a path using the cost set that we just generated.
// Get nodes from the graph
var nodes = graph.getNodes();
// Generate a graph using the alternate cost type, then generate one using the graph's
// default cost type, distance.
Vector3D[] start_nodes = {
nodes[0].ToVector3D(),
nodes[1].ToVector3D(),
nodes[2].ToVector3D(),
nodes[3].ToVector3D()
};
Vector3D[] end_nodes = {
nodes[101].ToVector3D(),
nodes[102].ToVector3D(),
nodes[103].ToVector3D(),
nodes[104].ToVector3D()
};
Path[] energy_path = ShortestPath.DijkstraShortestPathMulti(graph, start_nodes, end_nodes, energy_key);
Path[] distance_path = ShortestPath.DijkstraShortestPathMulti(graph, start_nodes, end_nodes);
// Print out every pair of paths
for (int i = 0; i < start_nodes.Length; i++)
{
output += String.Format("{0} to {1} Energy : {2}", start_nodes[i], end_nodes[i], energy_path[i]) + "\n";
output +=
String.Format("{0} to {1} Distance: {2}", start_nodes[i], end_nodes[i], distance_path[i]) + "\n";
}
Debug.WriteLine(output);
(-30, 0, 1.068) to (-27, -8, 1.295) Energy : [(0, 2.48), (4, 2.48), (12, 2.48), (25, 2.461), (37, 2.461), (47, 5.402), (60, 5.302), (77, 5.129), (101, 0)]
(-30, 0, 1.068) to (-27, -8, 1.295) Distance: [(0, 1), (4, 1), (12, 1), (25, 1), (37, 1), (47, 1.417), (60, 1.416), (77, 1.416), (101, 0)]
(-31, -1, 1.018) to (-26, -8, 1.427) Energy : [(1, 2.461), (11, 2.5), (24, 4.536), (37, 5.528), (48, 5.452), (61, 5.605), (78, 5.837), (102, 0)]
(-31, -1, 1.018) to (-26, -8, 1.427) Distance: [(1, 1), (11, 1), (24, 1.415), (37, 1.417), (48, 1.417), (61, 1.417), (78, 1.418), (102, 0)]
(-31, 0, 1.018) to (-25, -8, 1.556) Energy : [(2, 2.5), (1, 4.559), (12, 2.48), (25, 5.708), (38, 5.656), (49, 5.916), (62, 6.644), (79, 5.08), (103, 0)]
(-31, 0, 1.018) to (-25, -8, 1.556) Distance: [(2, 1), (1, 1.415), (12, 1), (25, 1.417), (38, 1.417), (49, 1.418), (62, 1.42), (79, 1.416), (103, 0)]
(-31, 1, 1.017) to (-25, -6, 1.678) Energy : [(3, 2.52), (2, 2.5), (1, 4.559), (12, 5.759), (26, 5.89), (39, 6.101), (50, 7.008), (64, 5.863), (83, 3.827), (104, 0)]
(-31, 1, 1.017) to (-25, -6, 1.678) Distance: [(3, 1), (2, 1), (1, 1.415), (12, 1.418), (26, 1.418), (39, 1.418), (50, 1.421), (64, 1.418), (83, 1.002), (104, 0)]

References DHARTAPI.Pathfinding.ShortestPath.DijkstraShortestPathMulti().

◆ DijkstraShortestPathMulti() [2/2]

static Path[] DHARTAPI.Pathfinding.ShortestPath.DijkstraShortestPathMulti ( Graph  graph,
int[]  start_ids,
int[]  end_ids,
string  cost_type = "" 
)
static

Find the shortest paths between each pair of start_id and end_id in order.

Parameters
graphThe graph to generate paths in.
start_idsIds for the start points to generate paths from.
end_idsIds for the end points to generate paths to
cost_typeThe type of cost to use for generating the path. If left blank, will use the cost that the graph was created with. In the case of the graph generator, the default cost is distance.
Returns
A list of paths in order from start_ids to end_ids. If a path could not be generated by a set of points, then the path at that location will be null.
Precondition
1) The length of start_ids must match the length of end_ids.
2) Every ID in start_ids and end_ids must be the ID of some node in graph.
3) If cost_type is not left as the default, then it must be the name of a valid cost already defined in graph.

Uses all available cores for parallel calculation.

Precondition
The length of start_ids must match the length of end_ids.
Exceptions
System.ArgumentExceptionLength of start_ids didn't equal length of end_ids
KeyNotFoundExceptioncost_type wasn't left as blank, and didn't refer to the name of any cost that already exists in the graph.
Example
// Load the OBJ from ddisk
var blob = OBJLoader.LoadOBJ("ExampleModels/energy_blob_zup.obj");
// Generate a BVH from it
EmbreeBVH bvh = new EmbreeBVH(blob, true);
// Setup graph variables
Vector3D start_point = new Vector3D(-30, 0, 20);
Vector3D spacing = new Vector3D(1, 1, 10);
int max_nodes = 10000;
float up_step = 5.0f;
float down_step = 5.0f;
float up_slope = 60.0f;
float down_slope = 60.0f;
int max_step_connections = 1;
int min_connections = 1;
// Generate a graph
bvh,
start_point,
spacing,
max_nodes,
up_step,
down_step,
up_slope,
down_slope,
max_step_connections,
min_connections,
-1
);
// Compress the graph so we can use it with pathfinding
graph.CompressToCSR();
// Calculate an alternate set of costs for the graph based on Energy Expenditure
// Get the unique key of this cost type. We'll use this to tell the pathfinder to generate
// a path using the cost set that we just generated.
// Generate a graph using the alternate cost type, then generate one using the graph's
// default cost type, distance.
int[] start_ids = {1, 2, 3, 4};
int[] end_ids = {101, 102, 103, 104};
Path[] energy_path = ShortestPath.DijkstraShortestPathMulti(graph, start_ids, end_ids, energy_key);
Path[] distance_path = ShortestPath.DijkstraShortestPathMulti(graph, start_ids, end_ids);
string output = "";
// Print out every pair of paths
for (int i = 0; i < start_ids.Length; i++)
{
output += String.Format("{0} to {1} Energy : {2}", start_ids[i], end_ids[i], energy_path[i]) + "\n";
output += String.Format("{0} to {1} Distance: {2}", start_ids[i], end_ids[i], distance_path[i]) + "\n";
}
Debug.WriteLine(output);
1 to 101 Energy : [(1, 2.461), (11, 2.5), (24, 2.5), (36, 4.491), (47, 5.402), (60, 5.302), (77, 5.129), (101, 0)]
1 to 101 Distance: [(1, 1), (11, 1), (24, 1), (36, 1.415), (47, 1.417), (60, 1.416), (77, 1.416), (101, 0)]
2 to 102 Energy : [(2, 2.5), (1, 2.461), (11, 2.5), (24, 4.536), (37, 5.528), (48, 5.452), (61, 5.605), (78, 5.837), (102, 0)]
2 to 102 Distance: [(2, 1), (1, 1), (11, 1), (24, 1.415), (37, 1.417), (48, 1.417), (61, 1.417), (78, 1.418), (102, 0)]
3 to 103 Energy : [(3, 2.52), (2, 2.5), (1, 4.559), (12, 2.48), (25, 5.708), (38, 5.656), (49, 5.916), (62, 6.644), (79, 5.08), (103, 0)]
3 to 103 Distance: [(3, 1), (2, 1), (1, 1.415), (12, 1), (25, 1.417), (38, 1.417), (49, 1.418), (62, 1.42), (79, 1.416), (103, 0)]
4 to 104 Energy : [(4, 2.48), (12, 5.759), (26, 5.89), (39, 6.101), (50, 7.008), (64, 5.863), (83, 3.827), (104, 0)]
4 to 104 Distance: [(4, 1), (12, 1.418), (26, 1.418), (39, 1.418), (50, 1.421), (64, 1.418), (83, 1.002), (104, 0)]

Referenced by DHARTAPI.Pathfinding.ShortestPath.DijkstraShortestPathMulti().

◆ GeneratePredecessorAndDistanceMatricies()

static void DHARTAPI.Pathfinding.ShortestPath.GeneratePredecessorAndDistanceMatricies ( Graph  g,
out UnmanagedFloatArray2D  out_dist,
out UnmanagedIntArray2D  out_predecessor,
string  cost_type = "" 
)
static

Calculate Predecessor and Distance Matricies for a graph.

Parameters
gGraph to calculate predeessor and distance matricies for
out_distOutput parameter for the distance matrix
out_predecessorOutput parameter for the predecessor matrix.
cost_typeType of cost to use for the distance and predecessor matricies. If left blank will use the default cost of the graph.
Exceptions
KeyNotFoundExceptionIf cost_type isn't left to the default, and does not match the key of any cost that already exists in the graph.
Postcondition
out_dist and out_predecessor are updated to contain the distance and predecessor matricies for g.
Example
// Create a graph, add some edges and nodes
Graph g = new Graph();
Vector3D[] nodes =
{
new Vector3D(1,2,3),
new Vector3D(4, 5, 6),
new Vector3D(7, 8, 9),
new Vector3D(10, 1, 2)
};
g.AddEdge(nodes[1], nodes[2], 20);
g.AddEdge(nodes[0], nodes[2], 5);
g.AddEdge(nodes[1], nodes[0], 10);
_ = g.CompressToCSR();
// Get the predecessor and distance matricies
// back from native code
UnmanagedFloatArray2D dist_matrix = null;
UnmanagedIntArray2D pred_matrix = null;
g,
out dist_matrix,
out pred_matrix
);
// Print to console
Debug.WriteLine(dist_matrix);
Debug.WriteLine(pred_matrix);
static void GeneratePredecessorAndDistanceMatricies(Graph g, out UnmanagedFloatArray2D out_dist, out UnmanagedIntArray2D out_predecessor, string cost_type="")
Calculate Predecessor and Distance Matricies for a graph.
Definition: ShortestPath.cs:392
Calculate the shortest path between points in a Graph.
Definition: Path.cs:6
[0, 15, 10, NaN, 0, NaN, NaN, 5, 0]
[0, 2, 0, -1, 1, -1, -1, 2, 2]

References DHARTAPI.SpatialStructures.Graph.NumNodes().


The documentation for this class was generated from the following file: