public class MultiGraphAdjacencyMatrix extends java.lang.Object implements SimpleGraph
Constructor and Description |
---|
MultiGraphAdjacencyMatrix(Graph graph) |
MultiGraphAdjacencyMatrix(MultiGraphAdjacencyMatrix g) |
MultiGraphAdjacencyMatrix(java.lang.String adjList) |
Modifier and Type | Method and Description |
---|---|
void |
addEdge(int i,
int j)
Unsafe but efficient edge addition.
|
boolean |
addEdges(java.util.ArrayList<SimpleEdge> edges)
Removes all of the edges from the list if they are all not present.
|
boolean |
addEdgesWithinTolerance(java.util.ArrayList<SimpleEdge> edges) |
void |
fromString(java.lang.String adjacencyListAsString) |
int |
getDegree(int index)
The degree will be defined as the sum of the weights of the edges, including negative weights.
|
DegreeSequence |
getDegreeSequence() |
int[] |
getNonIsolatedVertices() |
int |
getNumberOfEdges()
We count edge multiplicity and negative-weight edges.
|
int |
getNumberOfVertices() |
int |
getTolerance() |
boolean |
isEdge(int i,
int j) |
void |
removeEdge(int i,
int j)
Unsafe but efficient edge removal.
|
boolean |
removeEdges(java.util.ArrayList<SimpleEdge> edges)
Removes all of the edges from the list if they are all present.
|
boolean |
removeEdgesWithTolerance(java.util.ArrayList<SimpleEdge> edges) |
void |
setTolerance(int tolerance) |
public MultiGraphAdjacencyMatrix(Graph graph)
public MultiGraphAdjacencyMatrix(MultiGraphAdjacencyMatrix g)
public MultiGraphAdjacencyMatrix(java.lang.String adjList)
public void fromString(java.lang.String adjacencyListAsString)
public DegreeSequence getDegreeSequence()
getDegreeSequence
in interface SimpleGraph
public int getDegree(int index)
getDegree
in interface SimpleGraph
index
- public int getNumberOfEdges()
getNumberOfEdges
in interface SimpleGraph
public boolean addEdges(java.util.ArrayList<SimpleEdge> edges)
edges
- public boolean removeEdges(java.util.ArrayList<SimpleEdge> edges)
edges
- public void addEdge(int i, int j)
i
- j
- public void removeEdge(int i, int j)
i
- j
- public boolean isEdge(int i, int j)
public int getNumberOfVertices()
getNumberOfVertices
in interface SimpleGraph
public int[] getNonIsolatedVertices()
public int getTolerance()
public void setTolerance(int tolerance)
public boolean addEdgesWithinTolerance(java.util.ArrayList<SimpleEdge> edges)
public boolean removeEdgesWithTolerance(java.util.ArrayList<SimpleEdge> edges)