graphstruct.go: modified to make graph directed; TODO: update algorithm.go