Performance optimization: use a node index to objectify the graph.