Prunes out 2nd degree nodes and the intermediate edges from Highway Adjacency Matrix and Distance Adjacency Matrix