protected void createNodeGraph(Node node, Edge enteringEdge) { for (Edge edge : node.getEdges()) { if (edge == enteringEdge) { continue; } if (edge.getFirst() == node) { createNodeGraph(edge.getSecond(), edge); } else { createNodeGraph(edge.getFirst(), edge); } } }
private StringBuilder prettyFormat(StringBuilder sb, Node n, StringBuilder tab) { sb.append(tab).append('"').append(n).append('"').append('\n'); for (Edge e : n) { char c = e.getFirst(); sb.append(tab) .append(c) .append(" : ") .append(e) .append(" = ") .append(e.a) .append(',') .append(fix(e.b)) .append(',') .append(e.length()) .append('\n'); tab.append(" "); prettyFormat(sb, e.end, tab); tab.delete(tab.length() - 2, tab.length()); } return sb; }
public void removeEdge(final Edge e) { adjacency.get(e.getFirst()).remove(e); adjacency.get(e.getSecond()).remove(e.getBackEdge()); }
/** Adds an edge to the map */ public void add(Edge e) { edges.put(e.getFirst(), e); }