as far away from as possible. Formally, a vertex is pseudo-peripheral if, for each vertex with , it holds that . A level structure of the graph, given a starting vertex, is a partition of the graph's vertices into subsets by their distances from the starting vertex. A geodetic graph is one for which every pair of vertices has a unique shortest path connecting them. For example, all trees are geodetic. The weighted shortest-path distance generalises the geodesic distance to weighted graphs. In this case it is assumed that the weight of an edge represents its length or, for complex networks the cost of the interaction, and the weighted shortest-path distance is the minimum sum of weights across all the paths connecting and . See the shortest path problem for more details and algorithms. Algorithm for finding pseudo-peripheral vertices Often peripheral sparse matrix algorithms need a starting vertex with a high eccentricity. A peripheral vertex would be perfect, but is often hard to calculate. In most circumstances a pseudo-peripheral vertex can be used. A pseudo-peripheral vertex can easily be found with the following algorithm: Choose a vertex . Among all the vertices that are as far from as possible, let be one with minimal degree. If then set and repeat with step 2, else is a pseudo-peripheral vertex. See also Distance matrix Resistance distance Betweenness centrality Centrality Closeness Degree diameter problem for graphs and digraphs Metric graph Notes Graph theory Metric geometry