#Data describing edges of the graph
edges<-data.frame(from_vertex=c(0,0,1,1,2,2,3,4,4),
to_vertex=c(1,3,2,4,4,5,1,3,5),
cost=c(9,2,11,3,5,12,4,1,6))
#Construct cppRouting graph
graph<-makegraph(edges,directed=TRUE)
#Contract graph
contracted_graph<-cpp_contract(graph,silent=TRUE)
Run the code above in your browser using DataLab