Package ghidra.util.graph
Class SimpleWeightedDigraph
java.lang.Object
ghidra.util.graph.DirectedGraph
ghidra.util.graph.WeightedDigraph
ghidra.util.graph.SimpleWeightedDigraph
@Deprecated(forRemoval=true,
since="10.2")
public class SimpleWeightedDigraph
extends WeightedDigraph
Deprecated, for removal: This API element is subject to removal in a future version.
A simple graph is a graph with no parallel edges or loops. This class models
a simple digraph -- edges are directed and a single edge may go from any vertex
to any other vertex. It is possible to have edges A-->B and B-->A however.
Attempting to add an edge from A to B when an edge from A to B already exists
causes the edge weight to be increased by the defaultEdgeWeight or the weight
specified.
This class may be used when simple unweighted graphs are desired. (Simply ignore
edge weights.)
-
Constructor Summary
ConstructorDescriptionSimpleWeightedDigraph
(int vertexCapacity, int edgeCapacity) Deprecated, for removal: This API element is subject to removal in a future version.Constructor for SimpleWeightedDigraph.SimpleWeightedDigraph
(int vertexCapacity, int edgeCapacity, double defaultEdgeWeight) Deprecated, for removal: This API element is subject to removal in a future version.Constructor for SimpleWeightedDigraph.SimpleWeightedDigraph
(int vertexCapacity, int edgeCapacity, double defaultEdgeWeight, boolean loopsAllowed) Deprecated, for removal: This API element is subject to removal in a future version.Constructor for SimpleWeightedDigraph. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Deprecated, for removal: This API element is subject to removal in a future version.Add an edge with the the default edge weight.boolean
Deprecated, for removal: This API element is subject to removal in a future version.Add an edge with the the specified edge weight.copy()
Deprecated, for removal: This API element is subject to removal in a future version.double
Deprecated, for removal: This API element is subject to removal in a future version.Returns the weight of the specified edge.boolean
Deprecated, for removal: This API element is subject to removal in a future version.Removes Edge e from the graph.Methods inherited from class ghidra.util.graph.WeightedDigraph
degree, getDefaultEdgeWeight, getEdgeWeights, inDegree, intersectionWith, outDegree, selfDegree, setWeight, unionWith
Methods inherited from class ghidra.util.graph.DirectedGraph
add, areRelatedAs, assignVerticesToStrongComponents, clear, complexityDepth, contains, contains, containsAsSubgraph, copyAll, copyEdge, copyEdgeAttributeValues, copyVertex, copyVertexAttributeValues, descendantsGraph, edgeAttributes, edgeIterator, edges, getAncestors, getChildren, getChildren, getComponentContaining, getComponents, getDescendants, getDescendants, getEdgeArray, getEdgeAttribute, getEdgeProperty, getEdges, getEdges, getEdgeWithKey, getEntryPoints, getIncomingEdges, getLevels, getNeighborhood, getNeighborhood, getOutgoingEdges, getParents, getParents, getReferent, getSinks, getSources, getVertexArray, getVertexAttribute, getVertexProperty, getVertexWithKey, getVertices, getVerticesHavingReferent, getVerticesInContainingComponent, incomingEdges, inducedSubgraph, inValence, join, loopDegree, numEdges, numLoops, numSinks, numSources, numVertices, outgoingEdges, outValence, remove, selfEdges, setEdgeProperty, setVertexProperty, valence, vertexAttributes, vertexIterator, vertices, verticesUnreachableFromSources, verts2referentSet
-
Constructor Details
-
SimpleWeightedDigraph
public SimpleWeightedDigraph(int vertexCapacity, int edgeCapacity, double defaultEdgeWeight, boolean loopsAllowed) Deprecated, for removal: This API element is subject to removal in a future version.Constructor for SimpleWeightedDigraph.- Parameters:
vertexCapacity
- initially allocate space for this many vertices.edgeCapacity
- initially allocate space for this many edges.defaultEdgeWeight
- edges are given this weight at creation time by default. the default is 1.0 for constructors where not specified.loopsAllowed
- Loops are allowed in the graph if this value set true in constructor. Default value is false. If vertex weights are desired, the class can either be extended or a vertex attribute can be defined using the code DoubleAttribute vertexWeights = (DoubleAttribute)this.vertexAttributes().createAttribute("weight", AttributeManager.DOUBLE_TYPE);
-
SimpleWeightedDigraph
public SimpleWeightedDigraph(int vertexCapacity, int edgeCapacity, double defaultEdgeWeight) Deprecated, for removal: This API element is subject to removal in a future version.Constructor for SimpleWeightedDigraph. AllowLoops is false by default.- Parameters:
vertexCapacity
-edgeCapacity
-defaultEdgeWeight
-
-
SimpleWeightedDigraph
public SimpleWeightedDigraph(int vertexCapacity, int edgeCapacity) Deprecated, for removal: This API element is subject to removal in a future version.Constructor for SimpleWeightedDigraph. AllowLoops is false by default. The defaultEdgeWeight is 1.0.- Parameters:
vertexCapacity
-edgeCapacity
-
-
-
Method Details
-
add
Deprecated, for removal: This API element is subject to removal in a future version.Add an edge with the the default edge weight. If an edge from and to the vertices specified by the edge already exists in the graph, then the edge weight in increased by the default value.- Overrides:
add
in classWeightedDigraph
- Parameters:
e
- the edge to add.- Returns:
- true if the edge was added sucessfully.
-
add
Deprecated, for removal: This API element is subject to removal in a future version.Add an edge with the the specified edge weight. If an edge from and to the vertices specified by the edge already exists in the graph, then the edge weight in increased by the specified value.- Overrides:
add
in classWeightedDigraph
- Returns:
- true if the edge was added sucessfully.
-
remove
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DirectedGraph
Removes Edge e from the graph. No effect if the edge is not in the graph.- Overrides:
remove
in classDirectedGraph
-
getWeight
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:WeightedDigraph
Returns the weight of the specified edge.- Overrides:
getWeight
in classWeightedDigraph
-
copy
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
copy
in classWeightedDigraph
- Returns:
- A directed graph with the same vertices, edges, and attributes.
-