generic graph in go