Added Johnson's algorithm