(vertex VertexId)
| 70 | } |
| 71 | |
| 72 | func (g *graph) AddVertex(vertex VertexId) error { |
| 73 | i, _ := g.edges[vertex] |
| 74 | if i != nil { |
| 75 | return errors.New("Vertex already exists") |
| 76 | } |
| 77 | |
| 78 | g.edges[vertex] = make(map[VertexId]int) |
| 79 | |
| 80 | return nil |
| 81 | } |
| 82 | |
| 83 | func (g *graph) RemoveVertex(vertex VertexId) error { |
| 84 | if !g.IsVertex(vertex) { |
no outgoing calls