implemented EdgeWeightedDiGraph