Implementation of the most used graph algorithms.