Table of Contents

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

sources List<int>

A list of source vertices.

destinations List<int>

A list of destination vertices.

weights List<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

sources List<Point>

The list of source points for the edges.

destinations List<Point>

The list of destination points for the edges.

Returns

int[][]

An adjacency matrix for the graph.

Examples

Matrix.BuildAdjMatrixByPoints.dyn