import "github.com.openshift.origin.pkg.api.graph" graph := // create graph of people and their friends john := // find John node in graph colleaguesPredecessors := graph.PredecessorNodesByEdgeKind(john, "colleague") for colleaguesPredecessors.Next() { colleague := colleaguesPredecessors.Node() // do something with colleague } if err := colleaguesPredecessors.Err(); err != nil { // handle error }This code uses the PredecessorNodesByEdgeKind function to find all the people who are colleagues of John in the graph, and then iterates over each colleague node to perform some action.