/** * Create a new instance. * * @param graph the input graph * @throws IllegalArgumentException if the graph is not directed */ public AllDirectedPaths(Graph<V, E> graph) { this.graph = GraphTests.requireDirected(graph); }
/** * Create a simple cycle finder for the specified graph. * * @param graph - the DirectedGraph in which to find cycles. * * @throws IllegalArgumentException if the graph argument is <code> * null</code>. */ public SzwarcfiterLauerSimpleCycles(Graph<V, E> graph) { this.graph = GraphTests.requireDirected(graph, "Graph must be directed"); }
/** * Set the graph * * @param graph graph */ public void setGraph(Graph<V, E> graph) { this.graph = GraphTests.requireDirected(graph, "Graph must be directed"); }
/** * Create a simple cycle finder for the specified graph. * * @param graph - the DirectedGraph in which to find cycles. * * @throws IllegalArgumentException if the graph argument is <code> * null</code>. */ public TiernanSimpleCycles(Graph<V, E> graph) { this.graph = GraphTests.requireDirected(graph, "Graph must be directed"); }
/** * Create a simple cycle finder for the specified graph. * * @param graph - the DirectedGraph in which to find cycles. * * @throws IllegalArgumentException if the graph argument is <code> * null</code>. */ public TarjanSimpleCycles(Graph<V, E> graph) { this.graph = GraphTests.requireDirected(graph, "Graph must be directed"); }
/** * Creates a cycle detector for the specified graph. Currently only directed graphs are * supported. * * @param graph the directed graph in which to detect cycles */ public CycleDetector(Graph<V, E> graph) { this.graph = GraphTests.requireDirected(graph); }
/** * Set the graph * * @param graph graph */ public void setGraph(Graph<V, E> graph) { this.graph = GraphTests.requireDirected(graph, "Graph must be directed"); }
/** * Constructor for AsUndirectedGraph. * * @param g the backing directed graph over which an undirected view is to be created. * @throws IllegalArgumentException if the graph is not directed */ public AsUndirectedGraph(Graph<V, E> g) { super(g); GraphTests.requireDirected(g); }
/** * Create a new instance of the naive LCA finder. * * @param graph the input graph */ public NaiveLcaFinder(Graph<V, E> graph) { this.graph = GraphTests.requireDirected(graph, "Graph must be directed"); }
/** * Set the graph * * @param graph graph */ public void setGraph(Graph<V, E> graph) { this.graph = GraphTests.requireDirected(graph, "Graph must be directed"); }
/** * Set the graph * * @param graph graph */ public void setGraph(Graph<V, E> graph) { this.graph = GraphTests.requireDirected(graph, "Graph must be directed"); }
/** * Create a simple cycle finder for the specified graph. * * @param graph the DirectedGraph in which to find cycles. * * @throws IllegalArgumentException if the graph argument is <code> * null</code>. */ public HawickJamesSimpleCycles(Graph<V, E> graph) throws IllegalArgumentException { this.graph = GraphTests.requireDirected(graph, "Graph must be directed"); }
public AbstractStrongConnectivityInspector(Graph<V, E> graph) { this.graph = GraphTests.requireDirected(graph); }
/** * Checks that the specified graph is directed and throws an {@link IllegalArgumentException} if * it is not. Also checks that the graph reference is not {@code null} and throws a * {@link NullPointerException} if it is. * * @param graph the graph reference to check for beeing directed and not null * @param <V> the graph vertex type * @param <E> the graph edge type * @return {@code graph} if directed and not {@code null} * @throws NullPointerException if {@code graph} is {@code null} * @throws IllegalArgumentException if {@code graph} is not directed */ public static <V, E> Graph<V, E> requireDirected(Graph<V, E> graph) { return requireDirected(graph, GRAPH_MUST_BE_DIRECTED); }
/** * Create a simple cycle finder for the specified graph. * * @param graph - the DirectedGraph in which to find cycles. * * @throws IllegalArgumentException if the graph argument is <code> * null</code>. */ public JohnsonSimpleCycles(Graph<V, E> graph) { this.graph = GraphTests.requireDirected(graph, "Graph must be directed"); if (GraphTests.hasMultipleEdges(graph)) { throw new IllegalArgumentException("Graph should not have multiple (parallel) edges"); } }
/** * Creates a new instance of the algorithm * * @param graph graph on which shortest paths are searched. * * @throws IllegalArgumentException if the graph is null. * @throws IllegalArgumentException if the graph is undirected. * @throws IllegalArgumentException if the graph is not simple. */ public BaseKDisjointShortestPathsAlgorithm(Graph<V, E> graph) { this.originalGraph = graph; GraphTests.requireDirected(graph); if (!GraphTests.isSimple(graph)) { throw new IllegalArgumentException("Graph must be simple"); } }
GraphTests.requireDirected(graph);
GraphTests.requireDirected(directedGraph, "Graph must be directed");