'Return the subgraph consisting of the given nodes and edges
between thses nodes.
Parameters
nodes : array_like(int, ndim=1)
Array of node indices.
Returns
DiGraph
A DiGraph representing the subgraph.'

def subgraph(self, nodes):

    adj_matrix = self.csgraph[nodes, :][:, nodes]
    weighted = True
    if (self.node_labels is not None):
        node_labels = self.node_labels[nodes]
    else:
        node_labels = None
    return DiGraph(adj_matrix, weighted=weighted, node_labels=node_labels)
