Finds isolated nodes = nodes with no neighbors (degree zero)

        Returns
        -------
        :any:`list` of :obj:`GridDing0`
            List of nodes (Ding0 objects)
161518
def graph_isolated_nodes(self):
        
        return sorted(nx.isolates(self._graph), key=lambda x: repr(x))
27931
def determine_signs(nodes, edges, cutoff=1e-10):
    
    N = len(nodes)
    M = np.zeros((N, N), dtype=float)
    for a, b, w in edges:
        M[a, b] += w
    M = symmetrize(M)

    return get_signs(M, cutoff=cutoff, validate=False)
219616
def identify_vertex_neighbours(self, vertex):
        
        vertex = self._permutation[vertex]

        lpl = self.lend[vertex-1]
        lp = lpl

        neighbours = []

        while True:
            lp = self.lptr[lp-1]
            neighbours.append(self.lst[lp-1]-1)
            if (lp == lpl):
                break

        return self._deshuffle_simplices(neighbours)
384063
void findLargestAnglesForAllNodes() {
		for (int i = 0; i < listInfo.size(); i++) {
			NodeInfo info = listInfo.get(i);

			if( info.edges.size < 2 )
				continue;

			for (int k = 0, j = info.edges.size-1; k < info.edges.size; j=k,k++) {
				double angleA = info.edges.get(j).angle;
				double angleB = info.edges.get(k).angle;

				double distance = UtilAngle.distanceCCW(angleA,angleB);

				if( distance > info.angleBetween ) {
					info.angleBetween = distance;
					info.left = info.edges.get(j).target;
					info.right = info.edges.get(k).target;
				}
			}
		}
	}
1341580
def get_roots(self, relations=None, prefix=None):
        
        g = self.get_filtered_graph(relations=relations, prefix=prefix)
        # note: we also eliminate any singletons, which includes obsolete classes
        roots = [n for n in g.nodes() if len(list(g.predecessors(n))) == 0 and len(list(g.successors(n))) > 0]
        return roots
1018052
def get_connected_components(graph):
    

    list_of_components = []
    component = []  # Not strictly necessary due to the while loop structure, but it helps the automated analysis tools

    # Store a list of all unreached vertices
    unreached = set(graph.get_all_node_ids())
    to_explore = deque()

    while len(unreached) > 0:
        # This happens when we reach the end of a connected component and still have more vertices to search through
        if len(to_explore) == 0:
            n = unreached.pop()
            unreached.add(n)
            to_explore.append(n)
            component = []
            list_of_components.append(component)

        # This is the BFS that searches for connected vertices
        while len(to_explore) > 0:
            n = to_explore.pop()
            if n in unreached:
                component.append(n)
                unreached.remove(n)
                nodes = graph.neighbors(n)
                for n in nodes:
                    if n in unreached:
                        to_explore.append(n)

    return list_of_components
1308402
def adjacent(self, node_a, node_b):
        """"""
        neighbors = self.neighbors(node_a)
        return node_b in neighbors
1288460
def get_degrees(self):
        '''
        
        '''
        degree = {}
        if self.attr['type'] is not DIRECTED_GRAPH:
            for n in self.get_node_list():
                degree[n] = len(self.get_neighbors(n))
            return degree
        else:
            for n in self.get_node_list():
                degree[n] = (len(self.get_in_neighbors(n)) +
                             len(self.get_out_neighbors(n)))
1215920
def nodes(self):
        
        if self._nodes is None:
            self._nodes = layout_nodes(self, only_nodes=True)
        return self._nodes
537856
def get_neighbor_names(self, node_name: str, order: int = 1) -> list:
        
        logger.info("In get_neighbor_names()")
        node = self.graph.vs.find(name=node_name)
        neighbors = self.graph.neighborhood(node, order=order)
        names = self.graph.vs[neighbors]["name"]
        names.append(node_name)
        return list(names)
21094
def ind_nodes(self, graph=None):
        
        if graph is None:
            graph = self.graph

        dependent_nodes = set(
            node for dependents in six.itervalues(graph) for node in dependents
        )
        return [node for node in graph.keys() if node not in dependent_nodes]
1004493
def remove_isolated_nodes_op(graph):
    
    rv = graph.copy()
    nodes = list(nx.isolates(rv))
    rv.remove_nodes_from(nodes)
    return rv
186510
def without_nodes(self, edge: Edge) -> 'BipartiteGraph[TLeft, TRight, TEdgeValue]':
        """"""
        return BipartiteGraph(((n1, n2), v) for (n1, n2), v in self._edges.items() if n1 != edge[0] and n2 != edge[1])
362295
def get_input_nodes(G: nx.DiGraph) -> List[str]:
    
    return [n for n, d in G.in_degree() if d == 0]
622499
def calculateBoundingRect(self, nodes):
        
        out = QRectF()
        for node in nodes:
            rect = node.rect()
            pos = node.pos()
            
            bounding = QRectF(pos.x(), pos.y(), rect.width(), rect.height())
            out = out.united(bounding)
        
        return out
1061671
def getRequiredNodes(self):
        
        return {nodeShape:len(self.nodeReservations[nodeShape]) for nodeShape in self.nodeShapes}
53366
def remove_isolated_nodes(G):
    

    isolated_nodes = [node for node, degree in dict(G.degree()).items() if degree < 1]
    G.remove_nodes_from(isolated_nodes)
    log('Removed {:,} isolated nodes'.format(len(isolated_nodes)))
    return G