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

  Constructors
  Constructor
  Description
  `SimpleWeightedDigraph(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 Type
  Method
  Description
  `boolean`
  `add(Edge e)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Add an edge with the the default edge weight.
  `boolean`
  `add(Edge e, double weight)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Add an edge with the the specified edge weight.
  `DirectedGraph`
  `copy()`
  Deprecated, for removal: This API element is subject to removal in a future version.
  `double`
  `getWeight(Edge e)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Returns the weight of the specified edge.
  `boolean`
  `remove(Edge e)`
  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`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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

    public boolean add(Edge e)
    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 class `WeightedDigraph`
    Parameters:
      `e` - the edge to add.
    Returns:
      true if the edge was added sucessfully.

  - ### add

    public boolean add(Edge e, double weight)
    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 class `WeightedDigraph`
    Returns:
      true if the edge was added sucessfully.

  - ### remove

    public boolean remove(Edge e)
    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 class `DirectedGraph`

  - ### getWeight

    public double getWeight(Edge e)
    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 class `WeightedDigraph`

  - ### copy

    public DirectedGraph copy()
    Deprecated, for removal: This API element is subject to removal in a future version.
    Overrides:
      `copy` in class `WeightedDigraph`
    Returns:
      A directed graph with the same vertices, edges, and attributes.