Distance (graph theory)



In the mathematical field of graph theory, the distance between two vertices in a graph is the number of edges in a shortest path (also called a graph geodesic) connecting them. This is also known as the geodesic distance.[1] Notice that there may be more than one shortest path between two vertices.[2] If there is no path connecting the two vertices, i.e., if they belong to different connected components, then conventionally the distance is defined as infinite.


In the case of a directed graph the distance d(u,v)displaystyle d(u,v)d(u,v) between two vertices udisplaystyle uu and vdisplaystyle vv is defined as the length of a shortest directed path from udisplaystyle uu to vdisplaystyle vv consisting of arcs, provided at least one such path exists.[3] Notice that, in contrast with the case of undirected graphs, d(u,v)displaystyle d(u,v)d(u,v) does not necessarily coincide with d(v,u)displaystyle d(v,u)d(v,u), and it might be the case that one is defined while the other is not.




Contents





  • 1 Related concepts


  • 2 Algorithm for finding pseudo-peripheral vertices


  • 3 See also


  • 4 Notes




Related concepts


A metric space defined over a set of points in terms of distances in a graph defined over the set is called a graph metric.
The vertex set (of an undirected graph) and the distance function form a metric space, if and only if the graph is connected.


The eccentricity ϵ(v)displaystyle epsilon (v)epsilon (v) of a vertex vdisplaystyle vv is the greatest distance between vdisplaystyle vv and any other vertex. It can be thought of as how far a node is from the node most distant from it in the graph.


The radius rdisplaystyle rr of a graph is the minimum eccentricity of any vertex or, in symbols, r=minv∈Vϵ(v)displaystyle r=min _vin Vepsilon (v)r=min _vin Vepsilon (v).


The diameter ddisplaystyle dd of a graph is the maximum eccentricity of any vertex in the graph. That is, ddisplaystyle dd is the greatest distance between any pair of vertices or, alternatively, d=maxv∈Vϵ(v)displaystyle d=max _vin Vepsilon (v)d=max _vin Vepsilon (v). To find the diameter of a graph, first find the shortest path between each pair of vertices. The greatest length of any of these paths is the diameter of the graph.


A central vertex in a graph of radius rdisplaystyle rr is one whose eccentricity is rdisplaystyle rr—that is, a vertex that achieves the radius or, equivalently, a vertex vdisplaystyle vv such that ϵ(v)=rdisplaystyle epsilon (v)=repsilon (v)=r.


A peripheral vertex in a graph of diameter ddisplaystyle dd is one that is distance ddisplaystyle dd from some other vertex—that is, a vertex that achieves the diameter. Formally, vdisplaystyle vv is peripheral if ϵ(v)=ddisplaystyle epsilon (v)=depsilon (v)=d.


A pseudo-peripheral vertex vdisplaystyle vv has the property that for any vertex udisplaystyle uu, if vdisplaystyle vv is as far away from udisplaystyle uu as possible, then udisplaystyle uu is as far away from vdisplaystyle vv as possible. Formally, a vertex u is pseudo-peripheral,
if for each vertex v with d(u,v)=ϵ(u)displaystyle d(u,v)=epsilon (u)d(u,v)=epsilon (u) holds ϵ(u)=ϵ(v)displaystyle epsilon (u)=epsilon (v)epsilon (u)=epsilon (v).


The partition of a graph's vertices into subsets by their distances from a given starting vertex is called the level structure of the graph.


A graph such that for every pair of vertices there is a unique shortest path connecting them is called a geodetic graph. For example, all trees are geodetic.[4]



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:


  1. Choose a vertex udisplaystyle uu.

  2. Among all the vertices that are as far from udisplaystyle uu as possible, let vdisplaystyle vv be one with minimal degree.

  3. If ϵ(v)>ϵ(u)displaystyle epsilon (v)>epsilon (u)epsilon (v)>epsilon (u) then set u=vdisplaystyle u=vu=v and repeat with step 2, else udisplaystyle uu 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




  1. ^ Bouttier, Jérémie; Di Francesco,P.; Guitter, E. (July 2003). "Geodesic distance in planar graphs". Nuclear Physics B. 663 (3): 535–567. doi:10.1016/S0550-3213(03)00355-9. Retrieved 2008-04-23. By distance we mean here geodesic distance along the graph, namely the length of any shortest path between say two given faces.mw-parser-output cite.citationfont-style:inherit.mw-parser-output qquotes:"""""""'""'".mw-parser-output code.cs1-codecolor:inherit;background:inherit;border:inherit;padding:inherit.mw-parser-output .cs1-lock-free abackground:url("//upload.wikimedia.org/wikipedia/commons/thumb/6/65/Lock-green.svg/9px-Lock-green.svg.png")no-repeat;background-position:right .1em center.mw-parser-output .cs1-lock-limited a,.mw-parser-output .cs1-lock-registration abackground:url("//upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Lock-gray-alt-2.svg/9px-Lock-gray-alt-2.svg.png")no-repeat;background-position:right .1em center.mw-parser-output .cs1-lock-subscription abackground:url("//upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Lock-red-alt-2.svg/9px-Lock-red-alt-2.svg.png")no-repeat;background-position:right .1em center.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registrationcolor:#555.mw-parser-output .cs1-subscription span,.mw-parser-output .cs1-registration spanborder-bottom:1px dotted;cursor:help.mw-parser-output .cs1-hidden-errordisplay:none;font-size:100%.mw-parser-output .cs1-visible-errorfont-size:100%.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration,.mw-parser-output .cs1-formatfont-size:95%.mw-parser-output .cs1-kern-left,.mw-parser-output .cs1-kern-wl-leftpadding-left:0.2em.mw-parser-output .cs1-kern-right,.mw-parser-output .cs1-kern-wl-rightpadding-right:0.2em


  2. ^
    Weisstein, Eric W. "Graph Geodesic". MathWorld--A Wolfram Web Resource. Wolfram Research. Retrieved 2008-04-23. The length of the graph geodesic between these points d(u,v) is called the graph distance between u and v



  3. ^ F. Harary, Graph Theory, Addison-Wesley, 1969, p.199.


  4. ^ Øystein Ore, Theory of graphs [3rd ed., 1967], Colloquium Publications, American Mathematical Society, p. 104









這個網誌中的熱門文章

How to read a connectionString WITH PROVIDER in .NET Core?

Node.js Script on GitHub Pages or Amazon S3

Museum of Modern and Contemporary Art of Trento and Rovereto