MCPcopy Create free account
hub / github.com/alibaba/GraphScope / _suitable

Function _suitable

python/graphscope/nx/generators/random_graphs.py:288–305  ·  view source on GitHub ↗
(edges, potential_edges)

Source from the content-addressed store, hash-verified

286 return empty_graph(n)
287
288 def _suitable(edges, potential_edges):
289 # Helper subroutine to check if there are suitable edges remaining
290 # If False, the generation of the graph has failed
291 if not potential_edges:
292 return True
293 for s1 in potential_edges:
294 for s2 in potential_edges:
295 # Two iterators on the same dictionary are guaranteed
296 # to visit it in the same order if there are no
297 # intervening modifications.
298 if s1 == s2:
299 # Only need to consider s1-s2 pair one time
300 break
301 if s1 > s2:
302 s1, s2 = s2, s1
303 if (s1, s2) not in edges:
304 return True
305 return False
306
307 def _try_creation():
308 # Attempt to create an edge set

Callers 1

_try_creationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected