Examples of addEdge()


Examples of edu.uci.ics.jung.graph.DirectedSparseGraph.addEdge()

      {
         BoostRef<Edge,?> newVertex = new BoostRef<Edge,Object>(edge, EDGE, true);
        
           newGraph.addVertex(newVertex);
 
           newGraph.addEdge(new BoostRef<Edge, Object>(edge, EDGE, true), // use a new object with reference to the original edge
                 vertexMapping.get(graph.getSource(edge)), newVertex);
 
           newGraph.addEdge(new BoostRef<Edge, Object>(edge, EDGE, true), // use a new object with reference to the original edge
                 newVertex, vertexMapping.get(graph.getDest(edge)));
View Full Code Here

Examples of edu.uci.ics.jung.graph.DirectedSparseMultigraph.addEdge()

            }

            for (Node n : g.getNodes()) {
                for (Transition t : n.getTransitionsAsT()) {
                    go.addEdge(t.getLabel() + "<!--" +  Math.random() + "-->", n, t.getDestinationNode());
                    //JUNG's E set must be distinct, so chuck some random crap on the end of each label
                    //to make each one unique.  HTML is used when rendering so we hide the random crap with a comment
                }
            }
            try {
View Full Code Here

Examples of edu.uci.ics.jung.graph.Graph.addEdge()

    Edge e12 = new DirectedSparseEdge(v1, v2);
    e12.setUserDatum("ID", "12", UserData.SHARED);
    e12.setUserDatum("Name", "myEdge12", UserData.SHARED);
    e12.setUserDatum("Description", "myEdge 12 description", UserData.SHARED);
    e12.setUserDatum("Deepness", 2, UserData.SHARED);
    g.addEdge(e12);
    Edge e23 = new DirectedSparseEdge(v2, v3);
    e23.setUserDatum("ID", "23", UserData.SHARED);
    e23.setUserDatum("Name", "myEdge23", UserData.SHARED);
    e23.setUserDatum("Description", "myEdge 23 description", UserData.SHARED);
    e23.setUserDatum("Deepness", 1, UserData.SHARED);
View Full Code Here

Examples of edu.uci.ics.jung.graph.impl.DirectedSparseGraph.addEdge()

    {
      DeterministicVertex newSrc = DeterministicDirectedSparseGraph.copyVertex(newVertices,result,e.getSource()),
        newDst = DeterministicDirectedSparseGraph.copyVertex(newVertices, result, e.getDest());
      DirectedSparseEdge newEdge = new DirectedSparseEdge(newSrc,newDst);
      newEdge.addUserDatum(JUConstants.LABEL, ((HashSet<String>)e.getUserDatum(JUConstants.LABEL)).clone(), UserData.SHARED);
      result.addEdge(newEdge);
    }
    return result;
  }

  /** Returns an array of sequential numbers 0..howMany, randomly permuted.
View Full Code Here

Examples of instantbach.data.Graph.addEdge()

            BufferedReader in = new BufferedReader(new FileReader(file));

            String line = "";
            while ((line = in.readLine()) != null) {
                StringTokenizer t = new StringTokenizer(line," ");
                graph.addEdge(t.nextToken(),t.nextToken(),1);
            }

            in.close();
        } catch (Exception io) {
            io.printStackTrace();
View Full Code Here

Examples of net.wigis.graph.dnv.DNVGraph.addEdge()

                DNVNode otherNode = triangleToParent.get(newTri);
                if(otherNode != null && !parent.getAllNeighbors().contains(otherNode) && !parent.shareNeighbors(otherNode)){
                  DNVEdge edge = new DNVEdge(compressedGraph);
                  edge.setTo(parent);
                  edge.setFrom(otherNode);
                  compressedGraph.addEdge(0, edge);
                }
              }
            }
          }
          if(nodeToLines.get(node) != null){
View Full Code Here

Examples of nl.nanoworks.nanograph.model.DefaultGraphModel.addEdge()

        g.addNode(st.nextToken());

      st = new StringTokenizer(this.getParameter("edges"), ",-");

      while (st.hasMoreElements())
        g.addEdge("edge", st.nextToken(), st.nextToken());
    }
    else
    {
      // default graph
      g.addNode("Java");
View Full Code Here

Examples of noop.model.Library.addEdge()

    }
    if (operation.dest.vertex == Vertex.NONE) {
      throw new IllegalArgumentException("dest element has no vertex");
    }
    Library srcLibrary = workspace.lookupLibrary(operation.src.vertex.libraryUid);
    srcLibrary.addEdge(new Edge(operation.src.vertex, operation.type, operation.dest.vertex));
  }

  public void addProject(NewProjectOperation operation) {
    workspace.addProject(operation.project);
    operation.project.accept(addVertices);
View Full Code Here

Examples of org._3pq.jgrapht.DirectedGraph.addEdge()

        if(!dg.containsVertex(child)) {
          dg.addVertex(child);
        }
        //add edge, precondition: vertex key - child are already added to the graph
        Edge de = def.createEdge(key, child);
        dg.addEdge(de);
      }
    }
    /*
     * find the id's participating in the cycle, and return the intersection
     * with set of id's which actually produce references.
View Full Code Here

Examples of org._3pq.jgrapht.UndirectedGraph.addEdge()

      Factor factor = (Factor) it.next ();
      VarSet varSet = factor.varSet ();
      int nv = varSet.size ();
      for (int i = 0; i < nv; i++) {
        for (int j = i + 1; j < nv; j++) {
          g.addEdge (varSet.get (i), varSet.get (j));
        }
      }
    }

    return g;
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.