Package org._3pq.jgrapht.alg

Examples of org._3pq.jgrapht.alg.ConnectivityInspector.pathExists()


  //xxx Insanely inefficient stub
  public boolean isConnected (Variable v1, Variable v2)
  {
    UndirectedGraph g = Graphs.mdlToGraph (this);
    ConnectivityInspector ins = new ConnectivityInspector (g);
    return g.containsVertex (v1) && g.containsVertex (v2) && ins.pathExists (v1, v2);
  }

}
View Full Code Here


  private void checkForNoCycle (VarSet parents, Variable child, CPT cpt) {
    ConnectivityInspector inspector = new ConnectivityInspector (graph);
    for (Iterator it = parents.iterator (); it.hasNext ();) {
      Variable rent = (Variable) it.next ();
      if (inspector.pathExists (child, rent)) {
        throw new IllegalArgumentException ("Error adding CPT: Would create directed cycle"+
                        "From: "+rent+" To:"+child+"\nCPT: "+cpt);
      }
    }
  }
View Full Code Here

    int edgesAdded = 0;
    while (edgesAdded < numCliques - 1) {
      VarSet[] pair = (VarSet[]) pq.first();
      pq.remove(pair);

      if (!inspector.pathExists(pair[0], pair[1])) {
          g.addEdge(pair[0], pair[1]);
          edgesAdded++;
      }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.