Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class Node {
- public int x;
- public int y;
- public int lastIndex;
- public ArrayList<Node> edges = new ArrayList<Node>();
- public ArrayList<Integer> costs = new ArrayList<Integer>();
- public int outCost;
- public int index;
- public Node(int x, int y) {
- this.x = x;
- this.y = y;
- lastIndex = -1;
- }
- public void add(Node node, int cost) {
- edges.add(node);
- costs.add(cost);
- outCost++;
- }
- public Node getEdge(int i) {
- return edges.get(i);
- }
- public int getEdgesCount() {
- return outCost;
- }
- public void setIndex(int i) {
- index = i;
- }
- public void setLastIndex(int lastIndices) {
- lastIndex = lastIndices;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement