<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>Population</title>
</head>

<body>



<p align="left"><font size="6" color="#FF0000"><b><span lang="en-ca">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Prim </span>--<span lang="en-ca">A greedy algorithm in graph</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><b>This is actually another application of my BFS class, or you can call it <span lang="en-ca">fifth</span> edition of <span lang="en-ca">BFS class</span>, whatever.</b></pre>
</div>
<div align="left">
  <pre><b>The base framework <span lang="en-ca">remains basically same except that I create a new class which inherited from BFS class. Also</span></b></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>I simplified the Matrix class and make a light-weight &quot;BasicMatrix&quot; class. The function is mainly for inputting </b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>and outputting from files. The only two thing I need are &quot;readFromFile&quot; and &quot;items&quot; methods. And I make a static</b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>object inside the new &quot;Prim&quot; class. The Prim class override several virtual method from BFS. The other significant</b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>changes in BFS class is that I make some more virtual functions at different stages, like onBeforeCount, onNextNode,</b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>onNextLevel etc. These particular functions are particular moments during searching at which programmer need to </b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>write their own methods. These are similar in Delphi. </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">
  <pre><span lang="en-ca"><b>A minimum spanning tree can be obtained by Prim algorithm, it creates a root among the connected graph by choosing</b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>the smallest edge. Then every time it adds a minimum edge into that tree so that there is no circuits created by </b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>the edge. (This is redundant description of tree as tree is a graph with no circuit.)  </b></span></pre>
</div>
<div align="left">
  <b><font color="#ff0000" size="5"><span lang="en-ca">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">
  <pre><span lang="en-ca"><b>No matter how complicated a problem may become, we can divide and conquer it by counting! And breadth-first-search</b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>is one of the simplest way to do it. This is an application of my BFS class which allow user to override several</b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>key method to do the BFS. In this case, user need to override two method: createSon() and validateOption().</b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>The most important part is how to determine the smallest edge outside the tree which will not create a circuit after</b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>being add into tree. I implement this awkwardly from a long way. </b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>Firstly please take notice that the matrix is not adjacency matrix, it is incidence matrix because the former </b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>one simply won't work! The key element in algorithm is the edge not the vertices!  </b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>Secondly an edge would only connects with exactly two vertices and one vertices may connect with any number of </b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>edges. A big, big idea!  In order to simplify the job, I create two array of bool to hold edges (the options) and </b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>the vertices. They are choiceTaken, and vertexOption. The first one is in BFS class as I thought it could be a</b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>general way for programmer to record whatever he had chosen from options. The second one is specific for Prim class.</b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>Third idea is the trackBack function which is add into BFS class along with dataRec array. As it should be a general</b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>method when programmer want to backtrack the node in the tree. and it should be standardized.</b></span></pre>
</div>
<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><b>1. void BFS::trackBack()</b></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>This is a new method in BFS class to standardize the backtrack of nodes in tree and they are stored in dataRec[].</b></span></pre>
</div>
<div align="left">
  <pre><b>2.void Prim::findSmallest()</b></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>This is one of heart of Prim. It was invoked whenever a new node is going to be checked in method onNextNode.</b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>At the very beginning, only the smallest edge should be selected. </b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>Then it should first store all vertices into vertexOption. Then for all edges not in the tree and has a vertex in</b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>the tree, it compare and find the smallest edge. That is it!</b></span></pre>
</div>
<div align="left">
  <pre><b>3. bool Prim::isTheOne(int sonData)</b></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>This is another heart of Prim. At very beginning, the correct choice is the smallest edge. Then in successive </b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>level, it should find the edges outside tree and doesn't have both vertex in tree, but only one vertex in tree and</b></span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca"><b>has the value of edge exactly same as smallest. (A lot of conditions, right?)</b></span></pre>
</div>
<div align="left">
  <pre><b><font color="#ff0000" size="5"><span lang="en-ca">C</span>.</font></b><span lang="en-ca"><font size="5" color="#FF0000"><b>Further improvement</b></font></span></pre>
</div>
<div align="left">
  <pre><b><span lang="en-ca">1. The input is really a pain! The most bugs are coming from the huge Matrix.</span></b></pre>
</div>
<pre>　</pre>
<pre>#include &lt;iostream&gt;
#include &lt;cmath&gt;
#include &lt;fstream&gt;

using namespace std;

const int MaxSonCount =10;
const int MaxLevel = 24;
const int MaxOptionCount = 24;
const int MaxRow = 24;
const int MaxCol = 24;
const double LIMIT = 0.01;
const int INFINITE =1000;


enum VertexName
	{A_B,B_C,C_D,A_E,B_F,C_G,D_H,E_F,F_G,G_H,E_I,F_J,G_K,H_L,I_J,J_K,K_L,I_M,J_N,K_O,
		L_P,M_N,N_O,O_P};

char* VertexString[24] = 
	{&quot;ab&quot;,&quot;bc&quot;,&quot;cd&quot;,&quot;ae&quot;,&quot;bf&quot;,&quot;cg&quot;,&quot;dh&quot;,&quot;ef&quot;,&quot;fg&quot;,&quot;gh&quot;,&quot;ei&quot;,&quot;fj&quot;,&quot;gk&quot;,
	&quot;hl&quot;,&quot;ij&quot;,&quot;jk&quot;,&quot;kl&quot;,&quot;im&quot;,&quot;jn&quot;,&quot;ko&quot;,&quot;lp&quot;,&quot;mn&quot;,&quot;no&quot;,&quot;op&quot;};

int VertexOption[24] = {A_B,B_C,C_D,A_E,B_F,C_G,D_H,E_F,F_G,G_H,E_I,F_J,G_K,H_L,I_J,
	J_K,K_L,I_M,J_N,K_O,L_P,M_N,N_O,O_P};


class BasicMatrix
{
private:
	int rowNum;
	int colNum;
	double lst[MaxRow][MaxCol];
protected:
public:
	BasicMatrix();
	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);
};


class BFS
{
protected:
	static BFS *root;
	static int level;
	static int optionArray[MaxOptionCount];
	static int optionCount;
	static int maxLevel;
	static int dataRec[MaxLevel];
	static bool choiceTaken[MaxOptionCount];
	int depth;
	BFS* parent;
	BFS* sonArray[MaxSonCount];
	int data;
	int sonCount;
	int sonIndex;
	void addSon(int sonData);
	BFS* findBrother();
	BFS* findUncle();
	bool hasBrother();
	BFS* nextBrother();
	BFS* diving();
	void trackBack();
	void initialize(BFS* now);
	bool touchDown();
	bool canDive();
	bool generate();
	void traverse();
	void setMaxLevel(int max) { maxLevel = max;}
	void assignString(char** nameString);
	virtual BFS* createSon();
	virtual bool lastChance();
	virtual void doGenerate();
	virtual bool validateOption(int sonData);	
	virtual void onVisit(int&amp; counter);
	virtual void onBeforeCount();
	virtual void onNextLevel();
	virtual void onNextNode();
public:
	int getData(){return data;}
	BFS* getParent() { return parent;}
	void setOptionArray(int* array, int arraySize);
	void beginCount(int max);
};

int BFS::level = 0;
BFS* BFS::root;
int BFS::dataRec[MaxLevel];
int BFS::optionArray[MaxOptionCount] = {0};
int BFS::optionCount = 0;
int BFS::maxLevel = 0;
bool BFS::choiceTaken[MaxOptionCount];

class Prim: public BFS
{
private:
	static bool vertexOption[MaxRow];
	static BasicMatrix Mx;
	static int smallest;
	void findSmallest();
	void onBeforeCount();
	bool isTheOne(int sonData);
protected:
	BFS* createSon();
	bool validateOption(int sonData);
	void onNextLevel();
	void onNextNode();
	void onVisit(int&amp; counter);
public:
	void readFromFile(char* fileName);
	void display();
};
int Prim::smallest = 0;
BasicMatrix Prim::Mx;
bool Prim::vertexOption[MaxRow]={false};

int main()
{
	Prim thePrim;
	thePrim.readFromFile(&quot;c:\\nickedge.txt&quot;);
	thePrim.display();
	thePrim.setOptionArray(VertexOption, 24);
	thePrim.beginCount(16);
	return 0;
}

void Prim::onBeforeCount()
{
//	findSmallest();	
}

void Prim::display()
{
	Mx.display();
}

void Prim::onNextNode()
{
	findSmallest();//choiceTaken is useless here

}


void Prim::onVisit(int&amp; counter)
{
	int total=0;
	cout&lt;&lt;&quot;now it is:&quot;&lt;&lt;++counter;
	assignString(VertexString);
	trackBack();
	for (int i=0; i&lt;depth; i++)
	{
		for (int r=0; r&lt;Mx.row(); r++)
		{
			if (vertexOption[r]&amp;&amp;Mx.items(r, dataRec[i])&lt;INFINITE)
			{
				total+= Mx.items(r, dataRec[i]);
				break;
			}
		}
	}
	cout&lt;&lt;&quot;  total=&quot;&lt;&lt;total&lt;&lt;endl;
}


bool Prim::isTheOne(int sonData)
{
	bool theSmall=false;
	bool inPath=false;
	if (depth==0) //first time
	{
		for (int r=0; r&lt;Mx.row(); r++)
		{			
			if (Mx.items(r, sonData)==smallest)
			{
				return true;
			}
		}
		return false;
	}
	//trackBack();
	if (choiceTaken[sonData])
	{
		return false;//
	}
	for (int r=0; r&lt; Mx.row(); r++)
	{
		if (vertexOption[r])
		{
			if (Mx.items(r, sonData)!=INFINITE)
			{
				if (!inPath)
				{
					inPath = true;//find the candidate
				}
				else
				{
					return false;
				}
				if (Mx.items(r, sonData)==smallest)
				{
					theSmall= true;
				}
			}
		
		}
	}	
	return theSmall;
}


void Prim::findSmallest()
{
	smallest = INFINITE;

	if (level==0)
	{
		for (int r=0;r&lt;Mx.row(); r++)
		{
			for (int c=0;c&lt;Mx.col(); c++)
			{
				if (Mx.items(r,c)&lt;smallest)
				{
					smallest = Mx.items(r,c);
				}
			}
		}
	}
	else
	{
		trackBack();
	
		for (int r=0; r&lt;Mx.row(); r++)
		{
			vertexOption[r] = false;
		}
		for (int i=0; i&lt;depth; i++)
		{
			for (int r=0; r&lt;Mx.row(); r++)
			{
				if (Mx.items(r, dataRec[i])!= INFINITE)
				{
					vertexOption[r] = true;
				}
			}
		}
	
	
		for (r=0; r&lt;Mx.row(); r++)
		{
			for (int c=0; c&lt;Mx.col(); c++)
			{
				if (!choiceTaken[c]&amp;&amp;vertexOption[r]&amp;&amp;Mx.items(r, c)&lt;smallest)
				{
					smallest = Mx.items(r, c);
				}
			}	
		}
	}
}


void Prim::onNextLevel()
{
	//findSmallest();
}

bool Prim::validateOption(int sonData)
{
	return isTheOne(sonData);
}

BFS* Prim::createSon()
{
	BFS* ptr;
	ptr = new Prim;
	return ptr;
}

void Prim::readFromFile(char* fileName)
{
	Mx.readFromFile(fileName);
}

void BFS::setOptionArray(int *array, int arraySize)
{
	optionCount = arraySize;
	for (int i=0; i&lt; optionCount; i++)
	{
		optionArray[i] = array[i];
	}
}


BFS* BFS::createSon()
{
	BFS* ptr = new BFS;
	return ptr;
}

void BFS::onBeforeCount()
{
}

void BFS::trackBack()
{
	for (int i=0; i&lt;optionCount; i++)
	{
		choiceTaken[i]=false;
	}
	BFS* ptr = this;
	while(ptr!=NULL)
	{
		if (ptr-&gt;parent==NULL)
		{
			break;
		}
		dataRec[ptr-&gt;depth-1] = ptr-&gt;data;
		choiceTaken[ptr-&gt;data]= true;
		ptr = ptr-&gt;parent;
	}
}

void BFS::assignString(char** nameString)
{
	int temp[MaxLevel] = {0};
	BFS* ptr = this;

	while (ptr-&gt;parent!=NULL)
	{
		temp[ptr-&gt;depth-1] = ptr-&gt;data;
		ptr = ptr-&gt;parent;
	}
	cout&lt;&lt;&quot; The route is:&quot;;
	for (int i=0; i&lt;depth; i++)//depth is one more than level!!!!!!
	{
		cout&lt;&lt;nameString[temp[i]]&lt;&lt;&quot;, &quot;;
	}
	cout&lt;&lt;endl;
}

void BFS::onNextLevel()
{
}

void BFS::onVisit(int&amp; counter)
{
	cout&lt;&lt;&quot;now it is:&quot;&lt;&lt;++counter;
	assignString(VertexString);
}

bool BFS::validateOption(int sonData)
{
	return true;
}

void BFS::doGenerate()
{
	for (int i=0; i&lt;optionCount; i++)
	{
		if (validateOption(optionArray[i]))
		{
			addSon(optionArray[i]);
		}
	}
}

bool BFS::lastChance()
{
	return level==maxLevel-1;
}


void BFS::traverse()
{
	int counter=0;
	BFS* ptr= root;
	while (ptr!=NULL)
	{
		while(ptr-&gt;canDive())
		{
			ptr= ptr-&gt;sonArray[0];
		}
		ptr-&gt;onVisit(counter);
		
		if (ptr-&gt;hasBrother())
		{
			ptr= ptr-&gt;nextBrother();		
		}
		else
		{
			ptr=ptr-&gt;findUncle();
		}		
	}	
	cout&lt;&lt;&quot;The total number is :&quot;&lt;&lt;counter&lt;&lt;endl;
}


void BFS::beginCount(int max)
{
	setMaxLevel(max);
	initialize(this);
	onBeforeCount();
	while (generate())
	{
		if (!lastChance()) //true to keep go on
		{
			onNextLevel();
			level++;		
		}
		else
		{
			break;
		}
	}
	traverse();
}


bool BFS::generate()
{
	BFS* ptr= this;
	ptr = root-&gt;diving();
	if (ptr==NULL)
	{
		return false;
	}
	while (ptr!=NULL)
	{
		ptr-&gt;onNextNode();
		ptr-&gt;doGenerate();	
		ptr = ptr-&gt;findBrother();
	}

	return true;
}


bool BFS::touchDown()
{
	return depth ==level;
}

bool BFS::canDive()
{
	return sonCount&gt;0;
}

void BFS::initialize(BFS* now)
{
	root = now;
	root-&gt;depth = 0;
	root-&gt;sonCount = 0;
	root-&gt;sonIndex = -1;
	root-&gt;parent = NULL;
	root-&gt;data = 0;
	level = 0;
}


//NULL only when there is no more brother
BFS* BFS::diving()
{	
	BFS* ptr = this;
	while (!ptr-&gt;touchDown())
	{
		if (ptr-&gt;canDive())
		{
			ptr = ptr-&gt;sonArray[0];
		}
		else
		{
			if (ptr-&gt;hasBrother())
			{
				ptr = ptr-&gt;nextBrother();
			}
			else
			{
				ptr = ptr-&gt;findUncle();
			}
		}
		if (ptr==NULL)
		{
			break; //no more way to dive
		}
	}
	return ptr;
}

bool BFS::hasBrother()
{
	if (parent!=NULL)
	{
		if (parent-&gt;sonCount &gt; sonIndex+1)//has little brother
		{
			return true;
		}
	}
	return false;
}

BFS* BFS::nextBrother()
{
	if (parent!=NULL)
	{
		if (parent-&gt;sonCount &gt; sonIndex+1)//has little brother
		{
			return parent-&gt;sonArray[sonIndex+1]; //next little brother
		}
	}
	return NULL;
}


BFS* BFS::findUncle()
{
	BFS* ptr= this;
	while (!(ptr-&gt;hasBrother()))
	{
		ptr = ptr-&gt;parent;
		if (ptr==NULL)
		{
			return NULL;
		}
	}
	return ptr-&gt;nextBrother();

}

BFS* BFS::findBrother()
{
	BFS* ptr = this;
	if (ptr-&gt;hasBrother())
	{
		return ptr-&gt;nextBrother();
	}
	else
	{
		ptr = ptr-&gt;findUncle();
		if (ptr==NULL)
		{
			return NULL;
		}
		else
		{
			return ptr-&gt;diving();
		}
	}	
}


void BFS::addSon(int sonData)
{	
	BFS* ptr; 
	if (sonCount+1&lt;MaxSonCount)
	{
		ptr = createSon();	
		ptr-&gt;data = sonData;
		ptr-&gt;sonCount = 0;
		ptr-&gt;parent = this;
		ptr-&gt;depth = level+1;
		sonArray[sonCount] = ptr;		
		ptr-&gt;sonIndex = sonCount;
		sonCount++;
	}
	else
	{
		cout&lt;&lt;&quot;Exceed max of sons!&quot;;
	}
}


void BasicMatrix::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 BasicMatrix::initialize()
{
	for (int r=0; r &lt; rowNum; r++)
	{
		for (int c=0; c&lt; colNum; c++)
		{
			lst[r][c] = 0;
		}
	}	
}

void BasicMatrix::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);
}

BasicMatrix::BasicMatrix()
{
	rowNum = 5;
	colNum = 5;
	initialize();
}

void BFS::onNextNode()
{
}

double&amp; BasicMatrix::items(int r, int c)
{
	return lst[r][c];
}</pre>
<pre>
</pre>
<pre>
			
</pre>
<pre><font color="#FF0000"><a name="Result"></a>The following is <span lang="en-ca">the input</span> of program: (<span lang="en-ca">This is really a pain! It costs me hours.</span>)</font></pre>
<pre>1    1000 1000 1    1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1    2    1000 1000 3    1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 2    1    1000 1000 3    1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1    1000 1000 1000 1    1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1    1000 1000 1000 2    1000 1000 2    1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 3    1000 1000 2    3    1000 1000 3    1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 3    1000 1000 3    2    1000 1000 4    1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1    1000 1000 2    1000 1000 1000 3    1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 2    1000 1000 1000 3    1000 1000 3    1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 3    1000 1000 3    4    1000 1000 4    1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 4    1000 1000 4    3    1000 1000 3    1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 3    1000 1000 3    1000 1000 1000 2    1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 3    1000 1000 1000 2    1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 4    1000 1000 2    2    1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 3    1000 1000 2    3
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 2    1000 1000 3</pre>
<pre>　</pre>
<pre>　</pre>
<pre><span lang="en-ca">The result is too many! 4480!</span></pre>
<pre><span lang="en-ca">...</span></pre>
<pre><span lang="en-ca">...</span></pre>
<pre>now it is:4463 The route is:dh, cd, gh, bc, ab, ae, ei, ef, im, mn, no, ko, fj, op, lp, 
total=30
now it is:4464 The route is:dh, cd, gh, bc, ab, ae, ei, ef, im, mn, no, ko, hl, lp, fj, 
total=30
now it is:4465 The route is:dh, cd, gh, bc, ab, ae, ei, ef, im, mn, no, ko, hl, lp, ij, 
total=30
now it is:4466 The route is:dh, cd, gh, bc, ab, ae, ei, ef, im, mn, no, ko, ij, hl, lp, 
total=30
now it is:4467 The route is:dh, cd, gh, bc, ab, ae, ei, ef, im, mn, no, ko, ij, kl, lp, 
total=30
now it is:4468 The route is:dh, cd, gh, bc, ab, ae, ei, ef, im, mn, no, ko, ij, op, lp, 
total=30
now it is:4469 The route is:dh, cd, gh, bc, ab, ae, ei, ef, im, mn, no, ko, kl, lp, fj, 
total=30
now it is:4470 The route is:dh, cd, gh, bc, ab, ae, ei, ef, im, mn, no, ko, kl, lp, ij, 
total=30
now it is:4471 The route is:dh, cd, gh, bc, ab, ae, ei, ef, im, mn, no, ko, op, lp, fj, 
total=30
now it is:4472 The route is:dh, cd, gh, bc, ab, ae, ei, ef, im, mn, no, ko, op, lp, ij, 
total=30
now it is:4473 The route is:dh, cd, gh, bc, ab, ae, ei, ef, im, mn, no, op, lp, fj, kl, 
total=30
now it is:4474 The route is:dh, cd, gh, bc, ab, ae, ei, ef, im, mn, no, op, lp, fj, ko, 
total=30
now it is:4475 The route is:dh, cd, gh, bc, ab, ae, ei, ef, im, mn, no, op, lp, ij, kl, 
total=30
now it is:4476 The route is:dh, cd, gh, bc, ab, ae, ei, ef, im, mn, no, op, lp, ij, ko, 
total=30
now it is:4477 The route is:dh, cd, gh, bc, ab, ae, ei, ef, im, mn, no, op, lp, kl, fj, 
total=30
now it is:4478 The route is:dh, cd, gh, bc, ab, ae, ei, ef, im, mn, no, op, lp, kl, ij, 
total=30
now it is:4479 The route is:dh, cd, gh, bc, ab, ae, ei, ef, im, mn, no, op, lp, ko, fj, 
total=30
now it is:4480 The route is:dh, cd, gh, bc, ab, ae, ei, ef, im, mn, no, op, lp, ko, ij, 
total=30
The total number is :4480</pre>

<pre>　</pre>

<p>　</p>

<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="WhoAmI.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>