<html>

<head><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- MyFirstUnitAd -->
<ins class="adsbygoogle"
     style="display:inline-block;width:970px;height:250px"
     data-ad-client="ca-pub-5778386704669218"
     data-ad-slot="1503492166"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Bellman-Ford</title>
</head>

<body>



<p align="left"><font size="6" color="#FF0000"><span lang="en-ca"><b>&nbsp; 
 
</b></span><b>&nbsp;&nbsp;&nbsp; <span lang="en-ca">Bellman-Ford</span></b></font></p>

<div align="left">
  <pre><b><font color="#ff0000" size="5">A. <span lang="en-ca">First </span>Edition</font></b></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>This is just a small assignment from networking and the assignment is a theory one. But I am so lazy to do the</b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>numb-minded-mechanical job that I would rather my best friend, my laptop, to do it for me.</b></span></pre>
</div>
<div align="left">
  <pre><b><font color="#ff0000" size="5"><span lang="en-ca">B</span>.<span lang="en-ca"><a name="problem"></a>The problem</span></font></b></pre>
</div>
<div align="left">
  <p ALIGN="LEFT"><span lang="en-ca">Bellman-Ford is said to be a distributed 
  algorithm for routing algorithm. The question is just how the nodes in</span></p>
  <p ALIGN="LEFT"><span lang="en-ca">a network find out the cheapest route to 
  each other node. Considering the graph is an undirected graph with each</span></p>
  <p ALIGN="LEFT"><span lang="en-ca">vertex representing a router and with each 
  edge attached with an integer cost. The bigger the cost is, the </span></p>
  <p ALIGN="LEFT"><span lang="en-ca">slower for the transmission would pass 
  through the edge. </span></p>
  <b><font color="#ff0000" size="5"><span lang="en-ca"><a name="explain"></a>C</span>.<span lang="en-ca">The
  </span></font></b><span lang="en-ca"><font size="5" color="#FF0000"><b>idea of 
  program</b></font></span></div>
<div align="left">
  　</div>
<p ALIGN="LEFT"><span lang="en-ca"><font size="2"><b>I use adjacency matrix to 
represent the graph with each entry as the cost. If two vertices are not 
adjacent, the</b></font></span></p>
<p ALIGN="LEFT"><span lang="en-ca"><font size="2"><b>cost is &quot;INFINITE&quot; which is 
just -1. The following is the input matrix. However, at last I changed the </b>
</font></span></p>
<p ALIGN="LEFT"><span lang="en-ca"><font size="2"><b>&quot;INFINITE&quot; in routing 
matrix&nbsp; to be 1000. </b></font></span></p>
<p ALIGN="LEFT"><span lang="en-ca"><font size="2"><b>0 3 -1 3 -1 -1 -1<br>
3 0 2 -1 -1 -1 -1<br>
-1 2 0 2 2 -1 -1<br>
3 -1 2 0 6 -1 -1<br>
-1 -1 2 6 0 4 3<br>
-1 -1 -1 -1 4 0 -1<br>
-1 -1 -1 -1 3 -1 0</b></font></span></p>
<p ALIGN="LEFT">　</p>
<p ALIGN="LEFT"><span lang="en-ca"><font size="2"><b>The logic of Bellman-Ford 
algorithm is rather intuitive and simple. It is like people's exchanging 
information.</b></font></span></p>
<p ALIGN="LEFT"><span lang="en-ca"><font size="2"><b>i.e. People go to pub and 
talk and exchange information and compare with his old knowledge. When he find a 
new</b></font></span></p>
<p ALIGN="LEFT"><span lang="en-ca"><font size="2"><b>route, he updates his 
routing table. However, read the graph is a bit boring, so, I borrow my old 
code---matrix</b></font></span></p>
<p ALIGN="LEFT"><span lang="en-ca"><font size="2"><b>which already implement the 
&quot;readFromFile&quot; function. </b></font></span></p>
<div align="left">
  <pre><b><font color="#ff0000" size="5">D.<span lang="en-ca"><a name="Method"></a>The </span>major functions</font></b></pre>
</div>
<div align="left">
  <pre><span lang="en-ca">I add a small &quot;update&quot; function which will go through the new-found path and update the cost of each node in the path if possible.</span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca">Here, I mean to update when the original cost is bigger than current. I am not sure about the original algorithm. Probably it won't</span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca">bother to do this. Because it is much easy for man to observe the graph. </span></pre>
</div>
<div align="left">
  <pre><b><font color="#ff0000" size="5"><span lang="en-ca">E</span>.</font></b><span lang="en-ca"><font size="5" color="#FF0000"><b>Further improvement</b></font></span></pre>
</div>
<div align="left">
  <pre>　</pre>
</div>
<div align="left">
  <pre><b><font color="#ff0000" size="5"><span lang="en-ca">F</span>.</font></b><span lang="en-ca"><font size="5" color="#FF0000"><b>File listing</b></font></span></pre>
</div>
<div align="left">
  <pre><font size="3"><b><span lang="en-ca">1. matrix.h</span></b></font></pre>
</div>
<div align="left">
  <pre><font size="3"><b><span lang="en-ca">1. matrix.</span></b></font><span lang="en-ca"><font size="3"><b>cpp</b></font></span></pre>
</div>
<div align="left">
  <pre><font size="3"><b><span lang="en-ca">1. BellmanFord.cpp</span></b></font></pre>
</div>
<div align="left">
  <pre>　</pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><font size="3" color="#FF0000"><b>file name: matrix.h</b></font></span></pre>
</div>
<pre>#ifndef MATRIX_H
#define MATRIX_H

const int MaxRow = 10;
const int MaxCol = 10;
const double LIMIT = 0.01;


class Matrix
{
private:
	int rowNum;
	int colNum;
	double lst[MaxRow][MaxCol];
protected:
	void mul(int dest, double scalor);
	void mul(int source, int dest, double scalor);
public:
	Matrix();
	Matrix&amp; transform(int index1, int index2);
	int row() const {return rowNum;}
	int col() const {return colNum;}
	void setRow(const int newRow) { rowNum = newRow;}
	void setCol(const int newCol) { colNum = newCol;}
	void display(bool displayNumber= false);
	double&amp; items(int r, int c);
	void initialize();
	void readFromFile(const char* fileName);
	void assign(const Matrix&amp; other);
	Matrix&amp; operator = (Matrix&amp; other);
	Matrix&amp; transposition();	
	bool operator==(Matrix&amp; other);
	bool operator!=(Matrix&amp; other);
	double* operator[](int r);
};

#endif</pre>
<pre><span lang="en-ca"><font size="3" color="#FF0000"><b>file name: matrix.cpp</b></font></span></pre>
<pre>#include &lt;iostream&gt;
#include &lt;cmath&gt;
#include &lt;fstream&gt;
#include &quot;matrix.h&quot;

using namespace std;



double* Matrix::operator [](int r)
{
	return lst[r];
}

Matrix&amp; Matrix::transposition()
{
	double hold;
	int temp;
	for (int r =0; r&lt; rowNum; r++)
	{
		for (int c=0; c&lt; r; c++)
		{
			hold = lst[r][c];
			lst[r][c] = lst[c][r];
			lst[c][r] = hold;
		}
	}
	temp = rowNum;
	rowNum = colNum;
	colNum = temp;
	return (*this);
}


bool Matrix::operator==(Matrix&amp; other)
{
	if (row()!=other.row()||col()!=other.col())
	{
		return false;
	}
	for (int r=0; r&lt;row(); r++)
	{
		for (int c=0; c&lt;col(); c++)
		{
			if (items(r,c)!=other.items(r,c))
			{
				return false;
			}
		}
	}
	return true;
}

bool Matrix::operator !=(Matrix&amp; other)
{
	return !(this-&gt;operator ==(other));
}
			
Matrix&amp; Matrix::operator =(Matrix&amp; other)
{
	setRow(other.row());
	setCol(other.col());
	for (int r=0; r&lt; other.row(); r++)
	{
		for (int c=0; c&lt; other.col(); c++)
		{
			lst[r][c] = other.items(r, c);
		}
	}
	
	return (*this);
}

void Matrix::assign(const Matrix&amp; other)
{
	this-&gt;operator =((Matrix&amp;)other);
}


void Matrix::mul(int dest, double scalor)
{
	for (int c=0; c&lt; colNum; c++)
	{
		lst[dest][c] *= scalor;
	}
}


void Matrix::mul(int source, int dest, double scalor)
{
	for (int c=0; c&lt; colNum; c++)
	{
		lst[dest][c] += lst[source][c]*scalor;
	}
}


double&amp; Matrix::items(int r, int c)
{
	return lst[r][c];
}

void Matrix::readFromFile(const char* fileName)
{
	int r=0, c=0;
	char ch;
	ifstream f;
	f.open(fileName);
	while (!f.eof())
	{
		ch = f.peek();
		
		if (ch!=10)  //return char
		{
			
			f&gt;&gt;lst[r][c];
			c++;
			if (c&gt;colNum)
				colNum = c;
		}
		else
		{
			f.ignore();
			r++;
			setCol(c);
			c =0;
		}
	}
	if (r!=0)
	{
		setRow(r+1);
	}
}


void Matrix::initialize()
{
	for (int r=0; r &lt; rowNum; r++)
	{
		for (int c=0; c&lt; colNum; c++)
		{
			lst[r][c] = r*2+c;
		}
	}	
}

Matrix&amp; Matrix::transform(int index1, int index2)
{
	double hold;
	if (index1&lt;rowNum&amp;&amp;index2&lt;rowNum)
	{
		for (int i=0; i&lt;colNum; i++)
		{
			hold = lst[index1][i];
			lst[index1][i] = lst[index2][i];
			lst[index2][i] = hold;
		}
		for (i=0; i&lt; rowNum; i++)
		{
			hold = lst[i][index1];
			lst[i][index1] = lst[i][index2];
			lst[i][index2] = hold;
		}
	}
	return *this;
}




void Matrix::display(bool displayNumber)
{
//	int temp;
	long preFlag;
	int number=0;
	preFlag = cout.flags();
//	temp = cout.precision(4);
//	cout.setf(ios::fixed);
	
	cout&lt;&lt;&quot;\nrow\\col&quot;;
	for (int c=0; c&lt; colNum; c++)
	{
		cout&lt;&lt;&quot;  &quot;&lt;&lt;c;
	}
	cout&lt;&lt;&quot;\n\n&quot;;
	for (int r = 0; r&lt; rowNum; r++)
	{
		cout&lt;&lt;r&lt;&lt;&quot;\t &quot;;
		number = 0;
		for (c = 0; c&lt; colNum; c++)
		{
			cout&lt;&lt;(fabs(lst[r][c])&lt;LIMIT?0:lst[r][c])&lt;&lt;&quot;  &quot;;
			if (fabs(lst[r][c])&gt;=LIMIT)
			{
				number++;
			}
		}
		if (displayNumber)
		{
			cout&lt;&lt;number;
		}

		cout&lt;&lt;endl;
	}
//	cout.precision(temp);
	cout.flags(preFlag);
}

Matrix::Matrix()
{
	rowNum = 5;
	colNum = 5;
	initialize();
}
</pre>
<pre>　</pre>
<pre><span lang="en-ca"><font size="3" color="#FF0000"><b>file name: BellmanFord.cpp</b></font></span></pre>
<pre>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &quot;matrix.h&quot;

const int MaxVertex=10;
const int INFINITE=1000;


struct Node
{
	int index;
	int cost;
};

class Bellman
{
private:
	Matrix matrix;
	Node nodeMatrix[MaxVertex][MaxVertex];
	int row, col;
	void update(int r, int c, int first);
public:
	void readFile(char* fileName);
	void display();
	void displayMatrix();
	bool findCost(int r, int c);
	void doFindCost();
};

int main()
{
	Bellman B;
	B.readFile(&quot;nick.txt&quot;);
	B.display();
	B.doFindCost();
	//B.displayMatrix();
	B.display();

	return 0;
}

void Bellman::doFindCost()
{
	bool findNew;	
	do
	{
		findNew=false;
		for (int r=0; r&lt;row; r++)
		{
			for (int c=0; c&lt;col; c++)
			{				
				if (findCost(r, c))
				{					
					//display();
					printf(&quot;array[%d][%d]\n&quot;, r, c);
					findNew=true;
				}
			}			
			display();
		}
	}
	while (findNew);
}


bool Bellman::findCost(int r, int c)
{
	bool findNew=false;
	int oldCost=nodeMatrix[r][c].cost;
	int newCost, theRow;//, theCol;
	for (int i=0; i&lt;col; i++)
	{
		//HAVE A PATH		
		newCost=nodeMatrix[r][i].cost;
		//theCol=
		theRow=r;
		while ((theRow=nodeMatrix[theRow][i].index)!=INFINITE)
		{			
			//newCost += nodeMatrix[theRow][i].cost;
			if (i==theRow)
			{
				newCost=nodeMatrix[r][i].cost+nodeMatrix[theRow][c].cost;
				if (newCost&lt;oldCost)
				{
					nodeMatrix[r][c].cost=newCost;
					oldCost=newCost;
					nodeMatrix[r][c].index=nodeMatrix[r][i].index;
					update(r, c, i);
					findNew=true;					
				}
				break;
			}
		}
	}
	return findNew;
}


void Bellman::update(int r, int c, int first)
{
	int newCost, theRow;
	newCost=nodeMatrix[r][c].cost;
	theRow=r;
	while ((theRow=nodeMatrix[theRow][first].index)!=first)
	{
		if (newCost-nodeMatrix[r][theRow].cost&gt;0)
		{
			if (nodeMatrix[theRow][c].cost&gt;newCost-nodeMatrix[r][theRow].cost)
			{
				nodeMatrix[theRow][c].index=nodeMatrix[theRow][first].index;
				nodeMatrix[theRow][c].cost=newCost-nodeMatrix[r][theRow].cost;
			}
		}
	}
}



void Bellman::readFile(char* fileName)
{
	matrix.readFromFile(fileName);
	row=matrix.row();
	col=matrix.col();
	for (int r=0; r&lt;row; r++)
	{
		for (int c=0; c&lt;col; c++)
		{
			if (matrix[r][c]&gt;0)
			{
				nodeMatrix[r][c].index=c;
				nodeMatrix[r][c].cost=(int)matrix[r][c];
			}
			else
			{
				if (matrix[r][c]==0)
				{
					nodeMatrix[r][c].index=r;
					nodeMatrix[r][c].cost=0;
				}
				else
				{
					nodeMatrix[r][c].index=INFINITE;
					nodeMatrix[r][c].cost=INFINITE;
				}
			}
		}
	}

}

void Bellman::display()
{
	for (int i=0; i&lt;row; i++)
	{
		printf(&quot;\t%c&quot;, i+'A');
	}
	printf(&quot;\n------------------------------\n&quot;);

	for (int r=0; r&lt;row; r++)
	{
		printf(&quot;%c\t&quot;, r+'A');
		for (int c=0; c&lt;col; c++)
		{
			if (nodeMatrix[r][c].index!=INFINITE)
			{
				printf(&quot;(%c,%d)\t&quot;, nodeMatrix[r][c].index+'A', nodeMatrix[r][c].cost);
			}
			else
			{
				printf(&quot;(-,-)\t&quot;);
			}
		}
		printf(&quot;\n&quot;);
	}
}

void Bellman::displayMatrix()
{
	matrix.display();
}
</pre>
<pre>
</pre>
<pre>　</pre>
<pre></pre>
<pre></pre>
<pre><span lang="en-ca"><font color="#0000FF"><b>How to run?</b></font></span></pre>
<pre><span lang="en-ca"><font color="#0000FF"><b>1. You need the graph input matrix file---&quot;nick.txt&quot; which is like following:</b></font></span></pre>
<pre><span lang="en-ca"><font color="#0000FF"><b>0 3 -1 3 -1 -1 -1
3 0 2 -1 -1 -1 -1
-1 2 0 2 2 -1 -1
3 -1 2 0 6 -1 -1
-1 -1 2 6 0 4 3
-1 -1 -1 -1 4 0 -1
-1 -1 -1 -1 3 -1 0</b></font></span></pre>
<pre><span lang="en-ca"><font color="#0000FF"><b>2. I give two output version: one is a debug-version which shows each iteration the matrix discover new route;</b></font></span></pre>
<pre><span lang="en-ca"><font color="#0000FF"><b>the other is just the start and end matrix.</b></font></span></pre>
<pre>　</pre>
<pre><span lang="en-ca"><font color="#0000FF"><b>3. This the final clean output version:</b></font></span></pre>
<pre><span lang="en-ca"><font color="#0000FF"><b>	</b></font><font color="#FF0000">A B C D E F G
------------------------------
A (A,0) (B,3) (-,-) (D,3) (-,-) (-,-) (-,-) 
B (A,3) (B,0) (C,2) (-,-) (-,-) (-,-) (-,-) 
C (-,-) (B,2) (C,0) (D,2) (E,2) (-,-) (-,-) 
D (A,3) (-,-) (C,2) (D,0) (E,6) (-,-) (-,-) 
E (-,-) (-,-) (C,2) (D,6) (E,0) (F,4) (G,3) 
F (-,-) (-,-) (-,-) (-,-) (E,4) (F,0) (-,-) 
G (-,-) (-,-) (-,-) (-,-) (E,3) (-,-) (G,0) 
A B C D E F G
------------------------------
A (A,0) (B,3) (B,5) (D,3) (B,7) (D,11) (D,10) 
B (A,3) (B,0) (C,2) (C,4) (C,4) (C,8) (C,7) 
C (B,5) (B,2) (C,0) (D,2) (E,2) (E,6) (E,5) 
D (A,3) (C,4) (C,2) (D,0) (C,4) (C,8) (C,7) 
E (C,7) (C,4) (C,2) (C,4) (E,0) (F,4) (G,3) 
F (E,11) (E,8) (E,6) (E,8) (E,4) (F,0) (E,7) 
G (E,10) (E,7) (E,5) (E,7) (E,3) (E,7) (G,0) </font><b><font color="#0000FF">
</font></b></span></pre>
<pre><span lang="en-ca"> </span></pre>
<pre><span lang="en-ca"><font color="#0000FF"><b>4. The debug-version output:</b></font></span></pre>

<p>&nbsp;A B C D E F G<br>
------------------------------<br>
A (A,0) (B,3) (-,-) (D,3) (-,-) (-,-) (-,-)<br>
B (A,3) (B,0) (C,2) (-,-) (-,-) (-,-) (-,-)<br>
C (-,-) (B,2) (C,0) (D,2) (E,2) (-,-) (-,-)<br>
D (A,3) (-,-) (C,2) (D,0) (E,6) (-,-) (-,-)<br>
E (-,-) (-,-) (C,2) (D,6) (E,0) (F,4) (G,3)<br>
F (-,-) (-,-) (-,-) (-,-) (E,4) (F,0) (-,-)<br>
G (-,-) (-,-) (-,-) (-,-) (E,3) (-,-) (G,0)<br>
array[0][2]<br>
array[0][4]<br>
array[0][5]<br>
array[0][6]<br>
A B C D E F G<br>
------------------------------<br>
A (A,0) (B,3) (B,5) (D,3) (B,7) (B,11) (B,10)<br>
B (A,3) (B,0) (C,2) (-,-) (C,4) (C,8) (C,7)<br>
C (-,-) (B,2) (C,0) (D,2) (E,2) (E,6) (E,5)<br>
D (A,3) (-,-) (C,2) (D,0) (E,6) (-,-) (-,-)<br>
E (-,-) (-,-) (C,2) (D,6) (E,0) (F,4) (G,3)<br>
F (-,-) (-,-) (-,-) (-,-) (E,4) (F,0) (-,-)<br>
G (-,-) (-,-) (-,-) (-,-) (E,3) (-,-) (G,0)<br>
array[1][3]<br>
A B C D E F G<br>
------------------------------<br>
A (A,0) (B,3) (B,5) (D,3) (B,7) (B,11) (B,10)<br>
B (A,3) (B,0) (C,2) (C,4) (C,4) (C,8) (C,7)<br>
C (-,-) (B,2) (C,0) (D,2) (E,2) (E,6) (E,5)<br>
D (A,3) (-,-) (C,2) (D,0) (E,6) (-,-) (-,-)<br>
E (-,-) (-,-) (C,2) (D,6) (E,0) (F,4) (G,3)<br>
F (-,-) (-,-) (-,-) (-,-) (E,4) (F,0) (-,-)<br>
G (-,-) (-,-) (-,-) (-,-) (E,3) (-,-) (G,0)<br>
array[2][0]<br>
A B C D E F G<br>
------------------------------<br>
A (A,0) (B,3) (B,5) (D,3) (B,7) (B,11) (B,10)<br>
B (A,3) (B,0) (C,2) (C,4) (C,4) (C,8) (C,7)<br>
C (B,5) (B,2) (C,0) (D,2) (E,2) (E,6) (E,5)<br>
D (A,3) (-,-) (C,2) (D,0) (E,6) (-,-) (-,-)<br>
E (-,-) (-,-) (C,2) (D,6) (E,0) (F,4) (G,3)<br>
F (-,-) (-,-) (-,-) (-,-) (E,4) (F,0) (-,-)<br>
G (-,-) (-,-) (-,-) (-,-) (E,3) (-,-) (G,0)<br>
array[3][1]<br>
array[3][4]<br>
array[3][5]<br>
array[3][6]<br>
A B C D E F G<br>
------------------------------<br>
A (A,0) (B,3) (B,5) (D,3) (B,7) (B,11) (B,10)<br>
B (A,3) (B,0) (C,2) (C,4) (C,4) (C,8) (C,7)<br>
C (B,5) (B,2) (C,0) (D,2) (E,2) (E,6) (E,5)<br>
D (A,3) (C,4) (C,2) (D,0) (C,4) (C,8) (C,7)<br>
E (-,-) (-,-) (C,2) (D,6) (E,0) (F,4) (G,3)<br>
F (-,-) (-,-) (-,-) (-,-) (E,4) (F,0) (-,-)<br>
G (-,-) (-,-) (-,-) (-,-) (E,3) (-,-) (G,0)<br>
array[4][0]<br>
array[4][1]<br>
array[4][3]<br>
A B C D E F G<br>
------------------------------<br>
A (A,0) (B,3) (B,5) (D,3) (B,7) (B,11) (B,10)<br>
B (A,3) (B,0) (C,2) (C,4) (C,4) (C,8) (C,7)<br>
C (B,5) (B,2) (C,0) (D,2) (E,2) (E,6) (E,5)<br>
D (A,3) (C,4) (C,2) (D,0) (C,4) (C,8) (C,7)<br>
E (C,7) (C,4) (C,2) (C,4) (E,0) (F,4) (G,3)<br>
F (-,-) (-,-) (-,-) (-,-) (E,4) (F,0) (-,-)<br>
G (-,-) (-,-) (-,-) (-,-) (E,3) (-,-) (G,0)<br>
array[5][0]<br>
array[5][1]<br>
array[5][2]<br>
array[5][3]<br>
array[5][6]<br>
A B C D E F G<br>
------------------------------<br>
A (A,0) (B,3) (B,5) (D,3) (B,7) (B,11) (B,10)<br>
B (A,3) (B,0) (C,2) (C,4) (C,4) (C,8) (C,7)<br>
C (B,5) (B,2) (C,0) (D,2) (E,2) (E,6) (E,5)<br>
D (A,3) (C,4) (C,2) (D,0) (C,4) (C,8) (C,7)<br>
E (C,7) (C,4) (C,2) (C,4) (E,0) (F,4) (G,3)<br>
F (E,11) (E,8) (E,6) (E,8) (E,4) (F,0) (E,7)<br>
G (-,-) (-,-) (-,-) (-,-) (E,3) (-,-) (G,0)<br>
array[6][0]<br>
array[6][1]<br>
array[6][2]<br>
array[6][3]<br>
array[6][5]<br>
A B C D E F G<br>
------------------------------<br>
A (A,0) (B,3) (B,5) (D,3) (B,7) (B,11) (B,10)<br>
B (A,3) (B,0) (C,2) (C,4) (C,4) (C,8) (C,7)<br>
C (B,5) (B,2) (C,0) (D,2) (E,2) (E,6) (E,5)<br>
D (A,3) (C,4) (C,2) (D,0) (C,4) (C,8) (C,7)<br>
E (C,7) (C,4) (C,2) (C,4) (E,0) (F,4) (G,3)<br>
F (E,11) (E,8) (E,6) (E,8) (E,4) (F,0) (E,7)<br>
G (E,10) (E,7) (E,5) (E,7) (E,3) (E,7) (G,0)<br>
A B C D E F G<br>
------------------------------<br>
A (A,0) (B,3) (B,5) (D,3) (B,7) (B,11) (B,10)<br>
B (A,3) (B,0) (C,2) (C,4) (C,4) (C,8) (C,7)<br>
C (B,5) (B,2) (C,0) (D,2) (E,2) (E,6) (E,5)<br>
D (A,3) (C,4) (C,2) (D,0) (C,4) (C,8) (C,7)<br>
E (C,7) (C,4) (C,2) (C,4) (E,0) (F,4) (G,3)<br>
F (E,11) (E,8) (E,6) (E,8) (E,4) (F,0) (E,7)<br>
G (E,10) (E,7) (E,5) (E,7) (E,3) (E,7) (G,0)<br>
A B C D E F G<br>
------------------------------<br>
A (A,0) (B,3) (B,5) (D,3) (B,7) (B,11) (B,10)<br>
B (A,3) (B,0) (C,2) (C,4) (C,4) (C,8) (C,7)<br>
C (B,5) (B,2) (C,0) (D,2) (E,2) (E,6) (E,5)<br>
D (A,3) (C,4) (C,2) (D,0) (C,4) (C,8) (C,7)<br>
E (C,7) (C,4) (C,2) (C,4) (E,0) (F,4) (G,3)<br>
F (E,11) (E,8) (E,6) (E,8) (E,4) (F,0) (E,7)<br>
G (E,10) (E,7) (E,5) (E,7) (E,3) (E,7) (G,0)<br>
A B C D E F G<br>
------------------------------<br>
A (A,0) (B,3) (B,5) (D,3) (B,7) (B,11) (B,10)<br>
B (A,3) (B,0) (C,2) (C,4) (C,4) (C,8) (C,7)<br>
C (B,5) (B,2) (C,0) (D,2) (E,2) (E,6) (E,5)<br>
D (A,3) (C,4) (C,2) (D,0) (C,4) (C,8) (C,7)<br>
E (C,7) (C,4) (C,2) (C,4) (E,0) (F,4) (G,3)<br>
F (E,11) (E,8) (E,6) (E,8) (E,4) (F,0) (E,7)<br>
G (E,10) (E,7) (E,5) (E,7) (E,3) (E,7) (G,0)<br>
A B C D E F G<br>
------------------------------<br>
A (A,0) (B,3) (B,5) (D,3) (B,7) (B,11) (B,10)<br>
B (A,3) (B,0) (C,2) (C,4) (C,4) (C,8) (C,7)<br>
C (B,5) (B,2) (C,0) (D,2) (E,2) (E,6) (E,5)<br>
D (A,3) (C,4) (C,2) (D,0) (C,4) (C,8) (C,7)<br>
E (C,7) (C,4) (C,2) (C,4) (E,0) (F,4) (G,3)<br>
F (E,11) (E,8) (E,6) (E,8) (E,4) (F,0) (E,7)<br>
G (E,10) (E,7) (E,5) (E,7) (E,3) (E,7) (G,0)<br>
A B C D E F G<br>
------------------------------<br>
A (A,0) (B,3) (B,5) (D,3) (B,7) (B,11) (B,10)<br>
B (A,3) (B,0) (C,2) (C,4) (C,4) (C,8) (C,7)<br>
C (B,5) (B,2) (C,0) (D,2) (E,2) (E,6) (E,5)<br>
D (A,3) (C,4) (C,2) (D,0) (C,4) (C,8) (C,7)<br>
E (C,7) (C,4) (C,2) (C,4) (E,0) (F,4) (G,3)<br>
F (E,11) (E,8) (E,6) (E,8) (E,4) (F,0) (E,7)<br>
G (E,10) (E,7) (E,5) (E,7) (E,3) (E,7) (G,0)<br>
A B C D E F G<br>
------------------------------<br>
A (A,0) (B,3) (B,5) (D,3) (B,7) (B,11) (B,10)<br>
B (A,3) (B,0) (C,2) (C,4) (C,4) (C,8) (C,7)<br>
C (B,5) (B,2) (C,0) (D,2) (E,2) (E,6) (E,5)<br>
D (A,3) (C,4) (C,2) (D,0) (C,4) (C,8) (C,7)<br>
E (C,7) (C,4) (C,2) (C,4) (E,0) (F,4) (G,3)<br>
F (E,11) (E,8) (E,6) (E,8) (E,4) (F,0) (E,7)<br>
G (E,10) (E,7) (E,5) (E,7) (E,3) (E,7) (G,0)<br>
A B C D E F G<br>
------------------------------<br>
A (A,0) (B,3) (B,5) (D,3) (B,7) (B,11) (B,10)<br>
B (A,3) (B,0) (C,2) (C,4) (C,4) (C,8) (C,7)<br>
C (B,5) (B,2) (C,0) (D,2) (E,2) (E,6) (E,5)<br>
D (A,3) (C,4) (C,2) (D,0) (C,4) (C,8) (C,7)<br>
E (C,7) (C,4) (C,2) (C,4) (E,0) (F,4) (G,3)<br>
F (E,11) (E,8) (E,6) (E,8) (E,4) (F,0) (E,7)<br>
G (E,10) (E,7) (E,5) (E,7) (E,3) (E,7) (G,0)<br>
A B C D E F G<br>
------------------------------<br>
A (A,0) (B,3) (B,5) (D,3) (B,7) (B,11) (B,10)<br>
B (A,3) (B,0) (C,2) (C,4) (C,4) (C,8) (C,7)<br>
C (B,5) (B,2) (C,0) (D,2) (E,2) (E,6) (E,5)<br>
D (A,3) (C,4) (C,2) (D,0) (C,4) (C,8) (C,7)<br>
E (C,7) (C,4) (C,2) (C,4) (E,0) (F,4) (G,3)<br>
F (E,11) (E,8) (E,6) (E,8) (E,4) (F,0) (E,7)<br>
G (E,10) (E,7) (E,5) (E,7) (E,3) (E,7) (G,0)<br>
Press any key to continue</p>

<pre>
</pre>

<pre>　</pre>

<pre></pre>

<pre></pre>

<pre></pre>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                                   
&nbsp;&nbsp;&nbsp; <a href="PocketRuler.htm">                  







                       <img src="picture/back.gif" style="border: medium none" alt="back.gif (341 bytes)" width="32" height="35"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<a href="index.htm">
<img src="picture/up.gif" style="border: medium none" alt="up.gif (335 bytes)" width="35" height="32"></a>       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                         
<img src="picture/next.gif" style="border: medium none" alt="next.gif (337 bytes)" width="32" height="35">          


</p>

</body>

</html>