Class UniqueOnAcyclicGraphArcPathSearchAlgo<V,A,C extends Number & Comparable<C>>

java.lang.Object
org.jhotdraw8.graph.path.algo.UniqueOnAcyclicGraphArcPathSearchAlgo<V,A,C>
Type Parameters:
V - the vertex data type
A - the arrow data type
C - the cost number type
All Implemented Interfaces:
ArcPathSearchAlgo<V,A,C>

public class UniqueOnAcyclicGraphArcPathSearchAlgo<V,A,C extends Number & Comparable<C>> extends Object implements ArcPathSearchAlgo<V,A,C>
Searches a globally unique vertex path from a set of start vertices to a set of goal vertices using a breadth-first search algorithm on a directed acyclic graph.

Uniqueness is global up to (inclusive) the specified maximal depth.

This algorithm ignores cost limit. If you need it, use one of the shortest path search algorithms.

The graph must be acyclic. (If the graph has cycles, then this algorithm incorrectly considers a path as non-unique, if it can be reached by a walk.)

Performance characteristics:

When the algorithm returns a back link
exactly O( |A| + |V| ) within max depth
When the algorithm returns null
less or equal O( |A| + |V| ) within max depth

References:

Robert Sedgewick, Kevin Wayne. (2011)
Algorithms, 4th Edition. Chapter 4. Breadth-First Search. math.cmu.edu
Sampath Kannan, Sanjeef Khanna, Sudeepa Roy. (2008)
STCON in Directed Unique-Path Graphs. Chapter 2.1 Properties of Unique-Path Graphs. cis.upenn.edu