a simple graph representation and minimum algorithm implemented.