copy from https://github.com/gyuho/goraph/tree/master/graph
