Package lt.refactory.primsAlgo.graph

Examples of lt.refactory.primsAlgo.graph.Node


 
 
  public GraphMock(){
    edgeList = new ArrayList<T>();
    nodeList = new ArrayList<Node>();
    Node node1 = new Node(BigDecimal.valueOf(100),BigDecimal.valueOf(100));
    Node node2 = new Node(BigDecimal.valueOf(500),BigDecimal.valueOf(50));
    Node node3 = new Node(BigDecimal.valueOf(300),BigDecimal.valueOf(300));
    Node node4 = new Node(BigDecimal.valueOf(100),BigDecimal.valueOf(10));
   
    nodeList.add(node1);
    nodeList.add(node2);
    nodeList.add(node3);
    nodeList.add(node4);
View Full Code Here


    return BigDecimal.valueOf(Math.sqrt(length.doubleValue()));
  }

  public static <T extends Edge> boolean hasCycle(Graph<T> graph) {
    Stack<Node> result = new Stack<Node>();
    Node start = graph.getNodeList().get(0);

    Graph<T> graphToTest = PrimsAlgorithm.removeNodesWithoutEdges(graph);
    return depthFirstSearch(start, null, result, graphToTest);
  }
View Full Code Here

   
   
    BigDecimal middleX = BigDecimal.valueOf(minimumX + ((maximumX-minimumX)/2));
    BigDecimal middleY = BigDecimal.valueOf(minimumY + ((maximumY-minimumY)/2));
   
    return new Node(middleX, middleY);
  }
View Full Code Here

  @Override
  public void mousePressed(MouseEvent e) {
    BigDecimal x = BigDecimal.valueOf(e.getX());
    BigDecimal y = BigDecimal.valueOf(e.getY());
    Node newNode = new Node(x,y);
   
    for (Node node : controller.getGraph().getNodeList()) {
      if (isNear(node, newNode)) {
        return;
      }
View Full Code Here

TOP

Related Classes of lt.refactory.primsAlgo.graph.Node

Copyright © 2018 www.massapicom. 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.