(self, includeSubPaths = True, weighted = True, transposed=False)
return _sparse.coo_matrix( (data, (row, col)), shape=(self.vcount(), self.vcount()) ).tocsr()
Returns a sparse adjacency matrix of the higher-order network. By default, the entry 
            corresponding to a directed link source -> target is stored in row s and column t
            and can be accessed via A[s,t].
    
        @param includeSubPaths: if set to True, the returned adjacency matrix will 
            account for the occurrence of links of order k (i.e. paths of length k-1)
            as subpaths

        @param weighted: if set to False, the function returns a binary adjacency matrix.
          If set to True, adjacency matrix entries will contain the weight of an edge.
      
        @param transposed: whether to transpose the matrix or not.
Returns a sparse adjacency matrix of the higher-order network. By default, the entry 
            corresponding to a directed link source -> target is stored in row s and column t
            and can be accessed via A[s,t].
    
        @param includeSubPaths: if set to True, the returned adjacency matrix will 
            account for the occurrence of links of order k (i.e. paths of length k-1)
            as subpaths
Returns a sparse adjacency matrix of the higher - order network . By default the entry corresponding to a directed link source - > target is stored in row s and column t and can be accessed via A [ s t ] . @param includeSubPaths : if set to True the returned adjacency matrix will account for the occurrence of links of order k ( i . e . paths of length k - 1 ) as subpaths
def getAdjacencyMatrix(self, includeSubPaths = True, weighted = True, transposed=False):
        """
        Returns a sparse adjacency matrix of the higher-order network. By default, the entry 
            corresponding to a directed link source -> target is stored in row s and column t
            and can be accessed via A[s,t].
    
        @param includeSubPaths: if set to True, the returned adjacency matrix will 
            account for the occurrence of links of order k (i.e. paths of length k-1)
            as subpaths

        @param weighted: if set to False, the function returns a binary adjacency matrix.
          If set to True, adjacency matrix entries will contain the weight of an edge.
      
        @param transposed: whether to transpose the matrix or not.
        """        
    
        row = []
        col = []
        data = []
           
        if transposed:
            for s,t in self.edges:
                row.append(self.nodes.index(t))
                col.append(self.nodes.index(s))
        else:
            for s,t in self.edges:
                row.append(self.nodes.index(s))
                col.append(self.nodes.index(t))

        # create array with non-zero entries
        if not weighted:
            data = _np.ones(len(self.edges.keys()))
        else:
            if includeSubPaths:
                data = _np.array([float(x.sum()) for x in self.edges.values()])
            else:
                data = _np.array([float(x[1]) for x in self.edges.values()])

        return _sparse.coo_matrix( (data, (row, col)), shape=(self.vcount(), self.vcount()) ).tocsr()
def getAdjacencyMatrix ( self , includeSubPaths = True , weighted = True , transposed = False ) : row = [ ] col = [ ] data = [ ] if transposed : for s , t in self . edges : row . append ( self . nodes . index ( t ) ) col . append ( self . nodes . index ( s ) ) else : for s , t in self . edges : row . append ( self . nodes . index ( s ) ) col . append ( self . nodes . index ( t ) ) # create array with non-zero entries if not weighted : data = _np . ones ( len ( self . edges . keys ( ) ) ) else : if includeSubPaths : data = _np . array ( [ float ( x . sum ( ) ) for x in self . edges . values ( ) ] ) else : data = _np . array ( [ float ( x [ 1 ] ) for x in self . edges . values ( ) ] ) return _sparse . coo_matrix ( ( data , ( row , col ) ) , shape = ( self . vcount ( ) , self . vcount ( ) ) ) . tocsr ( )