@Test public void testRemoveEdge() { construtGraph(); graph.removeEdge(1, 2); assertEquals(graph.getVertexNumber(), 10); assertEquals(graph.getEdgeNumber(), 8); assertEquals(graph.getEdges().size(), 7); graph.removeEdge(1, 5); assertEquals(graph.getVertexNumber(), 10); assertEquals(graph.getEdgeNumber(), 8); assertEquals(graph.getEdges().size(), 7); graph.removeEdge(1, 3); assertEquals(graph.getVertexNumber(), 10); assertEquals(graph.getEdgeNumber(), 7); assertEquals(graph.getEdges().size(), 7); graph.removeEdge(1, 4); assertEquals(graph.getVertexNumber(), 10); assertEquals(graph.getEdgeNumber(), 6); assertEquals(graph.getEdges().size(), 6); graph.removeEdge(2, 5); assertEquals(graph.getVertexNumber(), 10); assertEquals(graph.getEdgeNumber(), 5); assertEquals(graph.getEdges().size(), 5); graph.removeEdge(3, 5); assertEquals(graph.getVertexNumber(), 10); assertEquals(graph.getEdgeNumber(), 4); assertEquals(graph.getEdges().size(), 4); graph.removeEdge(5, 7); assertEquals(graph.getVertexNumber(), 10); assertEquals(graph.getEdgeNumber(), 3); assertEquals(graph.getEdges().size(), 3); graph.removeEdge(10, 4); assertEquals(graph.getVertexNumber(), 10); assertEquals(graph.getEdgeNumber(), 2); assertEquals(graph.getEdges().size(), 2); graph.removeEdge(4, 6); assertEquals(graph.getVertexNumber(), 10); assertEquals(graph.getEdgeNumber(), 1); assertEquals(graph.getEdges().size(), 1); graph.removeEdge(6, 7); assertEquals(graph.getVertexNumber(), 10); assertEquals(graph.getEdgeNumber(), 0); assertTrue(graph.getEdges().isEmpty()); }
public synchronized void removeEdge(VK start, VK end) { removeEdge(start, end, edges); removeEdge(end, start, reverseEdges); }
Graph { public synchronized void removeEdge(VK start, VK end) { removeEdge(start, end, edges); removeEdge(end, start, reverseEdges); } }
Graph { public synchronized void removeEdge(VK start, VK end) { removeEdge(start, end, edges); removeEdge(end, start, reverseEdges); } Graph(); }
Graph { public synchronized void removeEdge(VK start, VK end) { removeEdge(start, end, edges); removeEdge(end, start, reverseEdges); } Graph(); synchronized void addVertex(VK key, VD vertex); synchronized void addVertexIfAbsent(VK key, VD vertex); synchronized void removeVertex(VK key); boolean addEdge(VK start, VK end); boolean addEdge(VK start, VK end, boolean createVertex); boolean addEdge(VK start, VK end, ED edge); synchronized boolean addEdge(VK start, VK end, ED edge, boolean createVertex); synchronized void removeEdge(VK start, VK end); boolean forceRefreshPreEdges(Collection<VK> addStartKeys,
                                      VK endKey); synchronized boolean forceRefreshPreEdges(Collection<VK> addStartKeys,
                                                   VK endKey,
                                                   boolean createVertex); boolean addRemoveMultiEdges(Collection<VK> removeStartKeys,
                                     Collection<VK> addStartKeys,
                                     VK endKey); synchronized boolean addRemoveMultiEdges(Collection<VK> removeStartKeys,
                                                  Collection<VK> addStartKeys,
                                                  VK endKey,
                                                  boolean createVertex); synchronized void clear(); synchronized boolean containsVertex(VK key); synchronized VD getVertex(VK key); Map<VK, VD> getVertices(); synchronized boolean containsEdge(VK startKey, VK endKey); Map<VK, Map<VK, ED>> getEdges(); synchronized ED getEdge(VK startKey, VK endKey); synchronized int getEdgeNumber(); int getVertexNumber(); synchronized Collection<VK> getStartVertex(); synchronized Collection<VK> getEndVertex(); Set<VK> getPreNode(VK key); Map<VK, ED> getPreNodeAttr(VK key); Set<VK> getPostNode(VK key); Map<VK, ED> getPostNodeAttr(VK key); synchronized int getIndegree(VK key); synchronized int getOutdegree(VK key); boolean hasCycle(); List<VK> broadFirstSearch(); List<VK> depthFirstSearch(); List<VK> topologicalSort(); synchronized boolean isConnected(); }
Graph { public synchronized void removeEdge(VK start, VK end) { removeEdge(start, end, edges); removeEdge(end, start, reverseEdges); } Graph(); synchronized void addVertex(VK key, VD vertex); synchronized void addVertexIfAbsent(VK key, VD vertex); synchronized void removeVertex(VK key); boolean addEdge(VK start, VK end); boolean addEdge(VK start, VK end, boolean createVertex); boolean addEdge(VK start, VK end, ED edge); synchronized boolean addEdge(VK start, VK end, ED edge, boolean createVertex); synchronized void removeEdge(VK start, VK end); boolean forceRefreshPreEdges(Collection<VK> addStartKeys,
                                      VK endKey); synchronized boolean forceRefreshPreEdges(Collection<VK> addStartKeys,
                                                   VK endKey,
                                                   boolean createVertex); boolean addRemoveMultiEdges(Collection<VK> removeStartKeys,
                                     Collection<VK> addStartKeys,
                                     VK endKey); synchronized boolean addRemoveMultiEdges(Collection<VK> removeStartKeys,
                                                  Collection<VK> addStartKeys,
                                                  VK endKey,
                                                  boolean createVertex); synchronized void clear(); synchronized boolean containsVertex(VK key); synchronized VD getVertex(VK key); Map<VK, VD> getVertices(); synchronized boolean containsEdge(VK startKey, VK endKey); Map<VK, Map<VK, ED>> getEdges(); synchronized ED getEdge(VK startKey, VK endKey); synchronized int getEdgeNumber(); int getVertexNumber(); synchronized Collection<VK> getStartVertex(); synchronized Collection<VK> getEndVertex(); Set<VK> getPreNode(VK key); Map<VK, ED> getPreNodeAttr(VK key); Set<VK> getPostNode(VK key); Map<VK, ED> getPostNodeAttr(VK key); synchronized int getIndegree(VK key); synchronized int getOutdegree(VK key); boolean hasCycle(); List<VK> broadFirstSearch(); List<VK> depthFirstSearch(); List<VK> topologicalSort(); synchronized boolean isConnected();  }