|
|
|
@ -14,3 +14,31 @@
|
|
|
|
|
vexnode adjust[7];
|
|
|
|
|
int e, n;
|
|
|
|
|
}
|
|
|
|
|
void createjz(){//创建邻接矩阵函数
|
|
|
|
|
edgenode *p;
|
|
|
|
|
aaa();
|
|
|
|
|
int i;
|
|
|
|
|
for(i=0;i<nm.n;i++){
|
|
|
|
|
p=nm.adjust[i].firstnode;
|
|
|
|
|
while(p!=NULL){
|
|
|
|
|
int h;
|
|
|
|
|
for(h=0;h<nm.n;h++)
|
|
|
|
|
if(!strcmp(p->a,nm.adjust[h].name)) break;
|
|
|
|
|
cont[i][h]=1;
|
|
|
|
|
p=p->next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void print() {
|
|
|
|
|
edgenode* p;
|
|
|
|
|
int i;
|
|
|
|
|
for(i=0;i<nm.n;i++){
|
|
|
|
|
printf("[%s]",nm.adjust[i].name);
|
|
|
|
|
p=nm.adjust[i].firstnode;
|
|
|
|
|
while(p!=NULL){
|
|
|
|
|
printf("-->[%s]",p->a);
|
|
|
|
|
p=p->next;
|
|
|
|
|
}
|
|
|
|
|
printf("\n");
|
|
|
|
|
}
|
|
|
|
|
}
|