import "github.com/openshift/origin/pkg/api/graph" g := graph.NewUniqueMutableGraph() vertex1 := graph.NewVertex("1") vertex2 := graph.NewVertex("2") g.AddVertex(vertex1) g.AddVertex(vertex2) g.AddEdge(vertex1, vertex2)
import "github.com/openshift/origin/pkg/api/graph" g := graph.NewUniqueMutableGraph() vertex1 := graph.NewVertex("1") vertex2 := graph.NewVertex("2") g.AddVertex(vertex1) g.AddVertex(vertex2) g.AddEdge(vertex1, vertex2) g.RemoveVertex(vertex2)This code is similar to the previous example, but it also removes vertex2 from the graph after creating it.