The problem with the HashMap is solved. The problem was that if you use
an own class as a key of the HashMap you need to define your own hash
code function.

As the exercise don't need a special hashcode function, I used the
attribute "name" of the class Vertex as the key of the hashmap