Class Matrix
- Namespace
- OpenMEPSandbox.Graph
- Assembly
- OpenMEPSandbox.dll
public class Matrix
- Inheritance
-
Matrix
- Inherited Members
Methods
BuildAdjMatrixByGraph(List<int>, List<int>, List<int>)
Builds an adjacency matrix for a graph given its source vertices, destination vertices, and edge weights.
public static int[][] BuildAdjMatrixByGraph(List<int> sources, List<int> destinations, List<int> weights)
Parameters
sourcesList<int>A list of source vertices.
destinationsList<int>A list of destination vertices.
weightsList<int>A list of edge weights.
Returns
- int[][]
An adjacency matrix representing the graph.
Examples
Matrix.BuildAdjMatrixByGraph.dyn
BuildAdjMatrixByPoints(List<Point>, List<Point>)
Builds an adjacency matrix for an undirected graph based on a list of source points and destination points. The weight of each edge is the Euclidean distance between the source and destination points, rounded to the nearest integer.
public static int[][] BuildAdjMatrixByPoints(List<Point> sources, List<Point> destinations)
Parameters
sourcesList<Point>The list of source points for the edges.
destinationsList<Point>The list of destination points for the edges.
Returns
- int[][]
An adjacency matrix for the graph.