Package bgu.bio.adt.graphs

Examples of bgu.bio.adt.graphs.FlexibleUndirectedGraph.addNode()


  public void testUnDirectedColoring1() {
    FlexibleUndirectedGraph graph = new FlexibleUndirectedGraph();
    graph.addNode();
    graph.addNode();
    graph.addNode();
    graph.addNode();
    graph.addNode();
    graph.addNode();
    graph.addNode();
    graph.addEdge(0, 1);
    graph.addEdge(0, 4);
View Full Code Here


    FlexibleUndirectedGraph graph = new FlexibleUndirectedGraph();
    graph.addNode();
    graph.addNode();
    graph.addNode();
    graph.addNode();
    graph.addNode();
    graph.addNode();
    graph.addNode();
    graph.addEdge(0, 1);
    graph.addEdge(0, 4);
    graph.addEdge(0, 3);
View Full Code Here

    graph.addNode();
    graph.addNode();
    graph.addNode();
    graph.addNode();
    graph.addNode();
    graph.addNode();
    graph.addNode();
    graph.addEdge(0, 1);
    graph.addEdge(0, 4);
    graph.addEdge(0, 3);
    graph.addEdge(3, 2);
View Full Code Here

    graph.addNode();
    graph.addNode();
    graph.addNode();
    graph.addNode();
    graph.addNode();
    graph.addNode();
    graph.addEdge(0, 1);
    graph.addEdge(0, 4);
    graph.addEdge(0, 3);
    graph.addEdge(3, 2);
    graph.addEdge(5, 3);
View Full Code Here

  @Test
  public void testSplitGraph() {
    FlexibleUndirectedGraph graph = new FlexibleUndirectedGraph();
    for (int i = 0; i < 7; i++) {
      graph.addNode();
    }
    graph.addEdge(0, 1);
    graph.addEdge(0, 2);
    graph.addEdge(0, 3);
    graph.addEdge(1, 4);
View Full Code Here

  @Test
  public void testUnDirectedDegeneracy1() {
    FlexibleUndirectedGraph graph = new FlexibleUndirectedGraph();
    int nodes = 10;
    for (int i = 0; i < nodes; i++) {
      graph.addNode();
    }

    for (int i = 1; i < nodes; i++) {
      graph.addEdge(0, i);
    }
View Full Code Here

  @Test
  public void testUndirectedClear() {
    FlexibleUndirectedGraph graph = new FlexibleUndirectedGraph();
    int nodes = 52;
    for (int i = 0; i < nodes; i++) {
      graph.addNode();
    }

    int[][] edges = new int[][] { { 0, 9 }, { 0, 10 }, { 0, 11 },
        { 0, 12 }, { 0, 13 }, { 0, 17 }, { 0, 18 }, { 0, 19 },
        { 0, 20 }, { 0, 24 }, { 0, 30 }, { 0, 41 }, { 0, 45 },
View Full Code Here

    graph.clear();
    Assert.assertEquals("Size is not empty after clear",
        graph.getNodeNum(), 0);
    Assert.assertEquals("Number of edges is not empty after clear",
        graph.getEdgeNum(), 0);
    graph.addNode();
    graph.addNode();
    Assert.assertEquals("Size is not as expected", graph.getNodeNum(), 2);
    Assert.assertEquals("Number of edges isn't as expected",
        graph.getEdgeNum(), 0);
    Assert.assertEquals("Maximal degree isn't as expected",
View Full Code Here

    Assert.assertEquals("Size is not empty after clear",
        graph.getNodeNum(), 0);
    Assert.assertEquals("Number of edges is not empty after clear",
        graph.getEdgeNum(), 0);
    graph.addNode();
    graph.addNode();
    Assert.assertEquals("Size is not as expected", graph.getNodeNum(), 2);
    Assert.assertEquals("Number of edges isn't as expected",
        graph.getEdgeNum(), 0);
    Assert.assertEquals("Maximal degree isn't as expected",
        graph.getMaxDeg(), 0);
View Full Code Here

  @Test
  public void testUnDirectedDegeneracy2() {
    FlexibleUndirectedGraph graph = new FlexibleUndirectedGraph();
    int nodes = 100;
    for (int i = 0; i < nodes; i++) {
      graph.addNode();
    }

    for (int i = 0; i < nodes; i++) {
      for (int j = i + 1; j < nodes; j++) {
        graph.addEdge(i, j);
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.