Thursday, 24 April 2014

Wap to check whether a Graph contains parallel edges or not using Incident matrix.

 void main()  
  int i,j,r,count4,count,total,n;  
  int m,a[55][55];  
  int flag=0;  
  printf(" Enter the no of vertices ");  
  scanf ("%d",&m);  
  printf(" Enter the no of edges ");  
  scanf ("%d",&n);  
  printf ("enter the incident \n");  
  for (i=0;i<m;i++)  
 for (i=0;i<m;++i)  
     for(r=0; r<n; ++r)  
       if(a[r][i] != a[r][j])  
       if(r == n)  
         printf("col %d is same as col %d\n", i+1, j+1);  
          if (flag==1)  
          printf (" \n parlle edge found ");  
          printf(" \n no prall edge found ");  

No comments:
Write comments

Featured post

List of Universities in Karnataka offering M.Sc Computer Science

The post-graduate programme in Computer Science (M.Sc Computer Science) contains two academic years duration and having a four semesters....

Popular Posts

Copyright @ 2011-2016