Determines whether a node n in G is almost simplicial.
G (NetworkX graph) – The graph on which to check whether node n is almost simplicial.
n (node) – A node in graph G.
is_almost_simplicial – True if all but one of its neighbors induce a clique
- Return type
This example checks whether node 0 is simplicial or almost simplicial for a \(K_5\) complete graph with one edge removed.
>>> K_5 = nx.complete_graph(5) >>> K_5.remove_edge(1,3) >>> dnx.is_simplicial(K_5, 0) False >>> dnx.is_almost_simplicial(K_5, 0) True