void fun(AdjGraph *adjGraph,char a[M],char p,char q)
{
	int i,j,dist[M];
	int minIndex,minle,temp;
//	int	minLen[M]={0};
	int qDex=findIndex(a,adjGraph->vexnum,q);
	ArcNode *head=adjGraph->arcGraph;
	ArcList *arcList=NULL;
	for(i=0;i<adjGraph->vexnum;i++)
	{
		dist[i]=MAXL;
	}
	dist[findIndex(a,adjGraph->vexnum,p)]=-1;
	arcList=searchNode(head,p);
	updateDist(dist,adjGraph->vexnum,arcList,qDex,p,0);
	for(j=1;j<adjGraph->vexnum;j++)
	{		
		minIndex=findMinDist(dist,adjGraph->vexnum);
//		minLen[minIndex]=dist[minIndex];
		temp=dist[minIndex];
		if(minIndex==qDex)
		{
			minle=dist[minIndex];
			break;
		}
		dist[minIndex]=-1;
		arcList=searchNode(head,a[minIndex]);
		updateDist(dist,adjGraph->vexnum,arcList,qDex,a[minIndex],temp);
	}
	printf("%d\n",minle);

}
Example #2
0
void GLCamera::setTarget(const glm::vec3& t)												{ m_Target = t; updateView(); updateDist(); }
Example #3
0
////////////////////////////////////////////
//////////////////SETTERS///////////////////
////////////////////////////////////////////
void GLCamera::setPosition(const glm::vec3& p)												{ m_CamPos = p; updateView(); updateDist(); }