def extract_articles(gid, graph, pz, weighting=None, length=3, **kwargs): """ : weight : scenario in ( '' , '' ) """ if weighting is None: weighting = ["1"] wneighbors = _weights(weighting) vs = pure_prox(graph, pz, length, wneighbors) return vs
def expand_subgraph(graph, expand, nodes, length=4, cut=100, weightings=None): pz = {} uuids = {v['uuid']: v.index for v in graph.vs} pz.update({uuids[p]: 1. / len(nodes) for p in nodes}) pz.update({uuids[p]: 1. for p in expand}) weightings = ["1"] if weightings in ([], None) else weightings wneighbors = _weights(weightings) vs = pure_prox(graph, pz, length, wneighbors) vs = sortcut(vs, cut) return vs
def extract(graph, pz, cut=50, weighting=None, length=3, **kwargs): wneighbors = _weights(weighting) vs = pure_prox(graph, pz, length, wneighbors) vs = sortcut(vs, cut) return vs