Trails and Graph Theory 6: Utilities

A few utility functions were created to help solve our maximum-length trail problem. Since most of you may not be interested in the code, I will first describe what each function does, and then append the source at the end for you to skip over.

First is report(graph, description=”), which reports of the number of edges and nodes of a graph, and some basic statistics. We will use our first example graph as an example. We make a small change to start with a Multigraph instead of a Graph, and to use ‘length’ instead of ‘weight’, to be more compatible with OSMnx later.

report(G)
16  nodes  
21  edges  
total length 0.02 miles  
number of odd intersections  : 10
number of even intersections  : 6
number of 2-way intersections  : 5
number of trailhead/terminus  : 1

The function draw(graph, title=”) displays our simple graphs, and can handle Multigraphs.

draw(G)

Trailhead/terminus points are dead-ends that cannot be included in a grand circuit, so it is computationally easier to eliminate them early, with delete_ends(graph).

Continue reading “Trails and Graph Theory 6: Utilities”

Mogollon Rim Trail 2021

And a bonus continuation resuming on the GET:

PDF download of trip journal.

XC Day to Shipman

MRT/GET 2021 Day 30, May 4,  Tuesday
• Start “seg27 detour water’, new bypass for Monticello Box
• End 28050 on Shipman Trail
• Miles walked: 23.8

What happens when you want to travel east, but all the ridges, canyons, and roads are oriented north-south? When you on the GET, you do a lot of cross-country (XC) navigating, going straight up one ridge and down into the drainage, several times in one day.

Starting out, my route does some road walk and then XC to rejoin the main GET route.

Continue reading “XC Day to Shipman”