⇤ ← Revision 1 as of 2010-12-18 10:54:14
772
Comment:
|
569
|
Deletions are marked like this. | Additions are marked like this. |
Line 8: | Line 8: |
#To Determine whether the given the given graph is a tree or not #Which means are the rows of incidence matrix independent A = matrix([[-1,1,0,0],[-1,0,1,0],[0,1,0,-1],[0,0,-1,1]]) print 'The incidence matrix is ' |
#To find the incidence matrix and its null-space print 'The incidence matrix is' A = matrix([[-1,-1,0,0,-1,0],[1,0,-1,-1,0,0],[0,1,1,0,0,-1],[0,0,0,1,1,1]]) |
Line 13: | Line 12: |
print 'The determinant of the matrix is' print det(A) if det(A)==0: print 'Since incidence matrix is singular, it is not a tree' else: print 'Since incidence matrix is non-singular, it is a tree' |
b = A.transpose() print 'Transpose of the matrix is ' print b |
Book
Linear Algebra
Author
Gilbert Strang
Edition
#To find the incidence matrix and its null-space print 'The incidence matrix is' A = matrix([[-1,-1,0,0,-1,0],[1,0,-1,-1,0,0],[0,1,1,0,0,-1],[0,0,0,1,1,1]]) print A b = A.transpose() print 'Transpose of the matrix is ' print b
Solution by:
- Arnab Basu, Student, IIT Roorkee
- Amit Tewari, Student, IIT Roorkee
- Rachit Jha, Student, IIT Roorkee
- Shubham Mittal, Student, IIT Roorkee