Adjacency, . , , Graph ( , ). Graph, , .
, , hashCode() equals() Graph , .
E: hashCode() equals() - , , . , , , Graph.
If it's equals()too expensive, you should use an adjacency list or matrix, but not just use node names. You must carefully indicate what exactly identifies the individual graphs and vertices (and therefore what makes them equal), and then have your string representation of the adjacency list use these properties instead of the node names. I suggest you write down this specification of your schedule, equal to operation down.
source
share