Create a graph with custom types and hashes
mainThe graph.New function requires a hash function to identify vertices. For built-in types like int, you can use graph.IntHash. For custom types, you must provide a function that returns a unique identifier (e.g., a string) for each instance of that type.
type City struct {
Name string
}
cityHash := func(c City) string {
return c.Name
}
g := graph.New(cityHash)
_ = g.AddVertex(london)