fix bug: counting too many tracks in subset of graph

added functions to count starts and ends in a subset of the graph, and
made ntracks used to select move into the number of tracks totally
contained in the interval.