#! /usr/bin/env python3 # def sauer_incidence ( ): #*****************************************************************************80 # ## sauer_incidence() sets up the incidence matrix associated with a network. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 10 April 2022 # # Author: # # John Burkardt # # Reference: # # Timothy Sauer, # "How search engines rate page quality", # Numerical Analysis, # Pearson, 2006. # ISBN: 0-321-2698-9, # LC: QA297.S348 # # Output: # # real A(15,15): a sparse incidence matrix. # import numpy as np A = np.array ( [ \ [ 0,1,0,0,0,0,0,0,1,0,0,0,0,0,0 ], \ [ 0,0,1,0,1,0,1,0,0,0,0,0,0,0,0 ], \ [ 0,1,0,0,0,1,0,1,0,0,0,0,0,0,0 ], \ [ 0,0,1,0,0,0,0,0,0,0,0,1,0,0,0 ], \ [ 1,0,0,0,0,0,0,0,0,1,0,0,0,0,0 ], \ [ 0,0,0,0,0,0,0,0,0,1,1,0,0,0,0 ], \ [ 0,0,0,0,0,0,0,0,0,1,1,0,0,0,0 ], \ [ 0,0,0,1,0,0,0,0,0,0,1,0,0,0,0 ], \ [ 0,0,0,0,1,1,0,0,0,1,0,0,0,0,0 ], \ [ 0,0,0,0,0,0,0,0,0,0,0,0,1,0,0 ], \ [ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 ], \ [ 0,0,0,0,0,0,1,1,0,0,1,0,0,0,0 ], \ [ 0,0,0,0,0,0,0,0,1,0,0,0,0,1,0 ], \ [ 0,0,0,0,0,0,0,0,0,1,1,0,1,0,1 ], \ [ 0,0,0,0,0,0,0,0,0,0,0,1,0,1,0 ] ] ) return A if ( __name__ == '__main__' ): A = sauer_incidence ( ) print ( A )