Algorithms and Graph in Python, Java and Haskell