Added specialized algo for edgeweigthed directed graph