This method adds an edge to the graph as follows: first check whether the
edge already exists in the graph; if it does not exist, then add the
edge and return true; if it does exist, then do nothing and return false.
Generic heap that also supports FIFO access, backed by a dynamic array;
stores items of type Object with priorities of type Comparable,
and correctly handles multiple items with the same priority.
This method removes an edge as follows: if the graph contains an edge
from source to target node, then this edge is removed and the weight of
the edge is returned.