MCPcopy Create free account
hub / github.com/bterwijn/memory_graph / create_graph

Function create_graph

src/depth_first.py:4–10  ·  view source on GitHub ↗
(names, nr_edges)

Source from the content-addressed store, hash-verified

2import random
3
4def create_graph(names, nr_edges):
5 graph = {}
6 names_set = set(names)
7 for i in names:
8 valid_edges = list(names_set - {i})
9 graph[i] = ''.join([ e for e in random.sample(valid_edges, nr_edges)])
10 return graph
11
12def depth_first(graph, begin, end):
13

Callers 1

depth_first.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected