Package org.ddolib.examples.layered.mcp
Class Graph
java.lang.Object
org.ddolib.examples.layered.mcp.Graph
Represents a Graph with adjacency matrix. Used for MCP problem
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGraph(int[][] adjacencyMatrix) Given an adjacency matrix instantiate a graph. -
Method Summary
-
Field Details
-
numNodes
public final int numNodesThe number of nodes in the graph. -
numEdges
public final int numEdgesThe number of edges in the graph.
-
-
Constructor Details
-
Graph
public Graph(int[][] adjacencyMatrix) Given an adjacency matrix instantiate a graph. As these class is only used for MCP, we suppose that 2 nodes are not connected if the edge has weight0- Parameters:
adjacencyMatrix- the adjacency matrix to initialize the graph
-
-
Method Details