| 206 | // graph. Returns $0$ if successful, a negative number if not. |
| 207 | |
| 208 | int |
| 209 | ArrayGraph::addEdge(int vertexTag, int otherVertexTag) |
| 210 | { |
| 211 | // get pointers to the vertices, if one does not exist return |
| 212 | |
| 213 | Vertex *vertex1 = this->getVertexPtr(vertexTag); |
| 214 | Vertex *vertex2 = this->getVertexPtr(otherVertexTag); |
| 215 | if ((vertex1 == 0) || (vertex2 == 0)) |
| 216 | return -1; |
| 217 | |
| 218 | // add an edge to each vertex |
| 219 | int result; |
| 220 | if ((result = vertex1->addEdge(otherVertexTag)) == 0) |
| 221 | if ((result = vertex2->addEdge(vertexTag)) == 0) |
| 222 | numEdge++; |
| 223 | |
| 224 | return result; |
| 225 | } |
| 226 | |
| 227 | // VertexIter \&getVertices(void);} |
| 228 | // A method which first invokes {\em reset()} on the graphs ArrayVertexIter |
nothing calls this directly
no test coverage detected