From 395cf8a6e1773af9d0d2bcd0cfe46f5a5bfa1b57 Mon Sep 17 00:00:00 2001 From: Giovanni Di Grezia Date: Thu, 22 May 2014 16:38:45 +0200 Subject: [PATCH] piccola variazione a adjacency list --- graph/AdjacencyListGraph.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/graph/AdjacencyListGraph.java b/graph/AdjacencyListGraph.java index b9352f2..3775f91 100644 --- a/graph/AdjacencyListGraph.java +++ b/graph/AdjacencyListGraph.java @@ -67,8 +67,7 @@ public class AdjacencyListGraph implements Graph { } // Return the other endvertex of an incident edge - public Vertex opposite(Vertex v, Edge e) - throws InvalidPositionException { + public Vertex opposite(Vertex v, Edge e) throws InvalidPositionException { checkVertex(v); MyEdge ee = checkEdge(e); Vertex[] endv = ee.endVertices(); @@ -81,8 +80,7 @@ public class AdjacencyListGraph implements Graph { } // Test whether two vertices are adjacent - public boolean areAdjacent(Vertex u, Vertex v) - throws InvalidPositionException { + public boolean areAdjacent(Vertex u, Vertex v) throws InvalidPositionException { // search the incidence list of the vertex with smaller degree Iterable> iterToSearch; if (degree(u) < degree(v)) { @@ -110,8 +108,7 @@ public class AdjacencyListGraph implements Graph { } // Insert and return a new edge with a given element between two vertices - public Edge insertEdge(Vertex v, Vertex w, E o) - throws InvalidPositionException { + public Edge insertEdge(Vertex v, Vertex w, E o) throws InvalidPositionException { MyVertex vv = checkVertex(v); MyVertex ww = checkVertex(w); MyEdge ee = new MyEdge(v, w, o);