@Override public boolean isNeighbor(V v1, V v2) { if (!containsVertex(v1) || !containsVertex(v2)) { throw new IllegalArgumentException( "At least one of these not in this graph: " + v1 + ", " + v2); } return this.getNeighbors(v1).contains(v2); }
public boolean isNeighbor(V v1, V v2) { if (!containsVertex(v1) || !containsVertex(v2)) throw new IllegalArgumentException("At least one of these not in this graph: " + v1 + ", " + v2); return this.getNeighbors(v1).contains(v2); }
@Override public int degree(V vertex) { if (!containsVertex(vertex)) { throw new IllegalArgumentException( vertex + " is not a vertex in this graph"); } return this.getIncidentEdges(vertex).size(); }
@Override public int getNeighborCount(V vertex) { if (!containsVertex(vertex)) { throw new IllegalArgumentException( vertex + " is not a vertex in this graph"); } return this.getNeighbors(vertex).size(); }
public int getNeighborCount(V vertex) { if (!containsVertex(vertex)) throw new IllegalArgumentException(vertex + " is not a vertex in this graph"); return this.getNeighbors(vertex).size(); }
public int degree(V vertex) { if (!containsVertex(vertex)) throw new IllegalArgumentException(vertex + " is not a vertex in this graph"); return this.getIncidentEdges(vertex).size(); }
@Override public boolean isIncident(V vertex, E edge) { if (!containsVertex(vertex) || !containsEdge(edge)) { throw new IllegalArgumentException( "At least one of these not in this graph: " + vertex + ", " + edge); } return this.getIncidentEdges(vertex).contains(edge); }
public boolean isIncident(V vertex, E edge) { if (!containsVertex(vertex) || !containsEdge(edge)) throw new IllegalArgumentException("At least one of these not in this graph: " + vertex + ", " + edge); return this.getIncidentEdges(vertex).contains(edge); }