# 6.2: Networks

- Page ID
- 22339

\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

\( \newcommand{\Span}{\mathrm{span}}\)

\( \newcommand{\id}{\mathrm{id}}\)

\( \newcommand{\Span}{\mathrm{span}}\)

\( \newcommand{\kernel}{\mathrm{null}\,}\)

\( \newcommand{\range}{\mathrm{range}\,}\)

\( \newcommand{\RealPart}{\mathrm{Re}}\)

\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

\( \newcommand{\Argument}{\mathrm{Arg}}\)

\( \newcommand{\norm}[1]{\| #1 \|}\)

\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)

\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)

\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vectorC}[1]{\textbf{#1}} \)

\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)A network is a connection of vertices through edges. The internet is an example of a network with computers as the vertices and the connections between these computers as edges.

A **spanning subgraph** is a graph that joins all of the vertices of a more complex graph, but does not create a circuit

This is a graph showing how six cities are linked by roads. This graph has many spanning subgraphs but two examples are shown below.

This graph spans all of the cities (vertices) of the original graph, but does not contain any circuits.

This graph spans all of the cities (vertices) of the original graph, but does not contain any circuits.

A **tree **is a graph that is connected and has no circuits. Therefore, a spanning subgraph is a tree and the examples of spanning subgraphs in Example \(\PageIndex{1}\) above are also trees.

- If a graph is a tree, there is one and only one path joining any two vertices. Conversely, if there is one and only one path joining any two vertices of a graph, the graph must be a tree.
- In a tree, every edge is a bridge. Conversely, if every edge of a connected graph is a bridge, then the graph must be a tree.
- A tree with N vertices must have N-1 edges.
- A connected graph with N vertices and N-1 edges must be a tree.

Consider the spanning subgraph highlighted in green shown in Figure \(\PageIndex{2}\).

- Tree Property 1

Look at the vertices Appleville and Heavytown. Since the graph is a tree, there is only one path joining these two cities. Also, since there is only one path between any two cities on the whole graph, then the graph must be a tree.

- Tree Property 2

Since the graph is a tree, notice that every edge of the graph is a bridge, which is an edge such that if it were removed the graph would become disconnected.

- Tree Property 3

Since the graph is a tree and it has six vertices, it must have N – 1 or six – 1 = five edges.

- Tree Property 4

Since the graph is connected and has six vertices and five edges, it must be a tree.

All of the graphs shown below are trees and they all satisfy the tree properties.

A **minimum spanning tree **is the tree that spans all of the vertices in a problem with the least cost (or time, or distance).

The above is a weighted graph where the numbers on each edge represent the cost of each edge. We want to find the minimum spanning tree of this graph so that we can find a network that will reach all vertices for the least total cost.

This is the minimum spanning tree for the graph with a total cost of 51.

Since some graphs are much more complicated than the previous example, we can use Kruskal’s Algorithm to always be able to find the minimum spanning tree for any graph.

- Find the cheapest link in the graph. If there is more than one, pick one at random. Mark it in red.
- Find the next cheapest link in the graph. If there is more than one, pick one at random. Mark it in red.
- Continue doing this as long as the next cheapest link does not create a red circuit.
- You are done when the red edges span every vertex of the graph without any circuits. The red edges are the MST (minimum spanning tree).

Suppose that it is desired to install a new fiber optic cable network between the six cities (A, B, C, D, E, and F) shown above for the least total cost. Also, suppose that the fiber optic cable can only be installed along the roadways shown above. The weighted graph above shows the cost (in millions of dollars) of installing the fiber optic cable along each roadway. We want to find the minimum spanning tree for this graph using Kruskal’s Algorithm.

Step 1: Find the cheapest link of the whole graph and mark it in red. The cheapest link is between B and C with a cost of four million dollars.

Step 2: Find the next cheapest link of the whole graph and mark it in red. The next cheapest link is between A and C with a cost of six million dollars.

Step 3: Find the next cheapest link of the whole graph and mark it in red as long as it does not create a red circuit. The next cheapest link is between C and E with a cost of seven million dollars.

Step 4: Find the next cheapest link of the whole graph and mark it in red as long as it does not create a red circuit. The next cheapest link is between B and D with a cost of eight million dollars.

Step 5: Find the next cheapest link of the whole graph and mark it in red as long as it does not create a red circuit. The next cheapest link is between A and B with a cost of nine million dollars, but that would create a red circuit so we cannot use it. Therefore, the next cheapest link after that is between E and F with a cost of 12 million dollars, which we are able to use. We cannot use the link between C and D which also has a cost of 12 million dollars because it would create a red circuit.

This was the last step and we now have the minimum spanning tree for the weighted graph with a total cost of $37,000,000.