Here you need to compare vertex.edge and msg.edge. Only checking if vertex.edge contains msg.edge is not enough. I would like to mark both vertices if there is any asymmetric. If this code, it is only marked one vertex.