Package org.jamesii.core.util.graph.trees

Examples of org.jamesii.core.util.graph.trees.SimpleTree.addEdge()


   */
  public void testBFS() {
    BreadthFirstSearch<Integer> bfs = new BreadthFirstSearch<>();
    SimpleTree tree = new SimpleTree(4);
    tree.setTreeRoot(0);
    tree.addEdge(new AnnotatedEdge<Integer, Double, Object>(1, 0));
    tree.addEdge(new AnnotatedEdge<Integer, Double, Object>(2, 0));
    tree.addEdge(new AnnotatedEdge<Integer, Double, Object>(3, 0));
    ListCallBack lcb = new ListCallBack();
    bfs.traverse(tree, lcb);
    assertEquals(4, lcb.getVisited().size());
View Full Code Here


  public void testBFS() {
    BreadthFirstSearch<Integer> bfs = new BreadthFirstSearch<>();
    SimpleTree tree = new SimpleTree(4);
    tree.setTreeRoot(0);
    tree.addEdge(new AnnotatedEdge<Integer, Double, Object>(1, 0));
    tree.addEdge(new AnnotatedEdge<Integer, Double, Object>(2, 0));
    tree.addEdge(new AnnotatedEdge<Integer, Double, Object>(3, 0));
    ListCallBack lcb = new ListCallBack();
    bfs.traverse(tree, lcb);
    assertEquals(4, lcb.getVisited().size());
    for (int i = 0; i < 4; i++) {
View Full Code Here

    BreadthFirstSearch<Integer> bfs = new BreadthFirstSearch<>();
    SimpleTree tree = new SimpleTree(4);
    tree.setTreeRoot(0);
    tree.addEdge(new AnnotatedEdge<Integer, Double, Object>(1, 0));
    tree.addEdge(new AnnotatedEdge<Integer, Double, Object>(2, 0));
    tree.addEdge(new AnnotatedEdge<Integer, Double, Object>(3, 0));
    ListCallBack lcb = new ListCallBack();
    bfs.traverse(tree, lcb);
    assertEquals(4, lcb.getVisited().size());
    for (int i = 0; i < 4; i++) {
      assertEquals(i, lcb.getVisited().get(i).intValue());
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.