\documentclass{article}
\usepackage{latexsym,eepic,makeidx,fancybox}
\usepackage[dvips]{graphicx} \usepackage[latin1]{inputenc} \usepackage[english]{babel} \usepackage{amstext,amssymb,amsmath,amsthm,youngtab}
\title{Note: Lengths of edges in terms of lengths of paths}
\date{Erik Aas and Brendan McKay}
\author{}
\theoremstyle{definition}
\newtheorem{theorem}{Theorem}
\newtheorem{proposition}{Proposition}
\newtheorem{lemma}{Lemma}
\newtheorem{conjecture}{Conjecture}
\newtheorem{definition}{Definition}
\newtheorem{remark}{Remark}
\newtheorem{claim}{Claim}
\newcommand{\p}{^\prime}
\newcommand{\pp}{^{\prime\prime}}
\newcommand{\lra}{\leftrightarrow}
\newcommand{\mbf}{\mathbf}
\newcommand{\mbb}{\mathbb}
\newcommand{\mcl}{\mathcal}
\begin{document} 
\maketitle
\abstract{Given a weighted graph, we give a necessary and sufficient condition for being able to deduce the length of all edges in the graph given the lengths of certain paths in the graph.}

\section{Introduction}
Let $G = (V,E)$ be an undirected graph, and $P \subseteq V$ any subset of nodes.
By a $P$-path we mean a simple (non-self-intersecting on the level of nodes) path with distinct endpoints, both in $P$.
We identify paths with their sets of edges which we in turn identify with their {\it characteristic vectors}.
The characteristic vector of $F\subseteq E$ is simply $\sum_{e\in F} e$ considered as an element in the vector space $W$ having one basis vector for each edge of $G$.

We think of the graph as a computer network, the nodes being routers and the edges being links.
It is possible to send packets through the network, and we assume that sending a packet through the edge $e$ takes time $t_e$.
The time needed to send a packet through a sequence of edges is the sum of the $t_e$ for each edge $e$ in the path.
The nodes in $P$ are special routers capable of sending and receiving packets.

The other routers in the network are less able. For each packet (rather, for each identifying name of a packet), each router is hardwired to forward the packet along a particular link, should it enter along any link of the router.
Thus each packet will be forwarded along a path in the network for which no router is visited twice (of course, the packet could end up in an infinite loop, but this will be avoided).
Furthermore the path starts and ends in distinct vertices in $P$. That is, the paths packets can be forwarded along are precisely the $P$-paths.

So by sending a packet from a router $A\in P$ to another router $B\in P$ along a prespecified $P$-path $\alpha$, one measures $\sum_{e\in\alpha} t_e$.
The following question becomes natural.


{\bf Question: Given the value $\sum_{e\in\alpha} t_e$ for each $P$-path $\alpha$, is it possible to compute the individual values $t_e$ for each edge $e\in E$?}

Clearly this is asking whether the set of vectors $\{\alpha$ is a $P$-path$\}$ span $W$ or not.

\section{Result}
\begin{theorem}
\label{main}
The $P$-paths span $W$ if and only if for every pair $u,v$ of vertices (possibly contained in $P$), every connected component of $G-u-v$ contains some node in $P$.
\end{theorem}

\begin{proof}
We first prove that if there are nodes $u,v$ and a component $C$ of $G-u-v$ with $C\cap P =\emptyset$, then the $P$-paths do not span $W$.

Suppose $u$ and $v$ are both incident to $C$ in $G$ (the case where only one of them is is even easier). Let $w_u$ be the sum of the edges between $u$ and $C$, and $w_v$ be the sum of edges between $v$ and $C$. Then $w_u - w_v$ is clearly not in the span of any $P$-path, since the scalar product of any $P$-path and $w_u - w_v$ is zero (since every $P$-path visiting $C$ must visit both $u$ and $v$).

\end{proof}

The other direction will be a consequence of the following two lemmas.

\begin{lemma}
Every cycle in $G$ is contained in the span of the $P$-paths.
\end{lemma}

\begin{proof}
Let $C$ be any non-self-intersecting cycle of $G$.
Consider the graph $G\p$ obtained from $G$ by adding a node $s$ adjacent to each node in $P$ and a node $t$ adjacent to each node in $C$.
The graph $G\p$ is $3$-connected, thus, by Menger's theorem (see chapter 3 in \cite{BM}), there are three vertex-disjoint paths from $s$ to $t$.
These three paths contain three mutually disjoint paths $A,B,C$, each starting in $P$ and ending in $a,b,c$ respectively, where $a,b,c$ are distinct nodes in $C$.

Let $\alpha = b\overrightarrow{C}c$, $\beta = c\overrightarrow{C}a$, $\gamma = a\overrightarrow{C}b$ be the three (mutually disjoint) parts of $C$ between $a,b,c$.

Note that 
$$C = \alpha + \beta + \gamma = $$
$$(A+\beta+\alpha+B) + (B+\gamma + \beta + C) + (C+\alpha+\gamma+A)$$
$$-((A+\gamma+B)+(B+\alpha+C)+(C+\beta+A)),$$
expressing $C$ in terms of (vectors of) $P$-paths.

Since every cycle is the sum of non-self-intersecting cycles, we are done.
\end{proof}

\begin{lemma}
Every edge is contained in the span of all cycles in $G$.
\end{lemma}

\begin{proof}
Let $e = \{u,v\}$ be any edge in $G$.
There are two edge disjoint paths $A,B$ between $u$ and $v$ in $G-e$ (which is $2$-edge-connected). Thus $e = ((A+e) + (B+e) - (A+B))/2$ expresses $e$ in terms of cycles of $G$.
\end{proof}

\section{Remarks}
Clearly, Theorem \ref{main} still holds in the case where we allow parallel edges between distinct vertices.
It also holds when we change our ground field to any other field of characteristic $\neq 2$.
It does not hold over a field of characteristic 2 (which without loss of generality we may assume to be $\mbb{F}_2$, since the characteristic vectors belong to this field); in that case the dimension is $|V(G)|-|E(G)|-1$, as is well-known (see, for instance, chapter 12 in \cite{BM}).

Theorem 1 can be extended to the more general setting of $2$-connected graphs.
The resulting theorem is still of the form 'the obvious necessary condition is sufficient', although the obvious necessary condition becomes more complicated in this case.
It can be proved by considering the SPQR tree decomposition \cite{HT} of the $2$-connected graph.
One interesting special case is when all SPQR tree nodes are of type R.
Then the span of the $P$-paths is precisely the orthogonal complement of all $w_u-w_v$ (defined in the proof of the Theorem 1) ranging over all $2$-cuts $\{u,v\}$.

\begin{thebibliography}{9}
\bibitem{BM} J. A. Bondy, U. S. R. Murty, Graph theory with applications, American Elsevier Publishing Co., Inc., New York, 1976.
\bibitem{HT} J. E. Hopcroft and R. E. Tarjan. Dividing a graph into triconnected components. SIAM J. Comput., 2(3):135-158, 1973.

\end{thebibliography}

\end{document}
