Package ghidra.graph.algo

# Class JohnsonCircuitsAlgorithm<V,E extends GEdge<V>>

java.lang.Object
ghidra.graph.algo.JohnsonCircuitsAlgorithm<V,E>

Type Parameters:
  `V` - the vertex type
  `E` - the edge type

public class JohnsonCircuitsAlgorithm<V,E extends GEdge<V>> extends Object
Finds all circuits (loops) in the given graph.

Warning: This is a recursive algorithm. As such, it is limited in how deep it can recurse. Any path that exceeds the `JAVA_STACK_DEPTH_LIMIT` will not be found.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `JAVA_STACK_DEPTH_LIMIT`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JohnsonCircuitsAlgorithm(GDirectedGraph<V,E> g, Accumulator<List<V>> accumulator)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `compute(boolean uniqueCircuits, TaskMonitor monitor)`
  Finds the circuits in the graph passed at construction time.

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

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

- ## Field Details

  - ### JAVA_STACK_DEPTH_LIMIT

    public static final int JAVA_STACK_DEPTH_LIMIT
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### JohnsonCircuitsAlgorithm

    public JohnsonCircuitsAlgorithm(GDirectedGraph<V,E> g, Accumulator<List<V>> accumulator)

- ## Method Details

  - ### compute

    public void compute(boolean uniqueCircuits, TaskMonitor monitor) throws CancelledException
    Finds the circuits in the graph passed at construction time.
    Parameters:
      `uniqueCircuits` - true signals to return only unique circuits, where no two circuits will contain the same vertex
      `monitor` - the task monitor
    Throws:
      `CancelledException` - if the monitor is cancelled