Random mutations
def dfs(s, adj):
xs = [s]
visited = set()
while xs:
u = xs.pop()
if u not in visited:
print(u)
visited.add(u)
for v in adj.get(u, []):
xs.append(v)
def bfs(s, adj):
xs = [s]
visited = set()
while xs:
u = xs.pop(0)
if u not in visited:
print(u)
visited.add(u)
for v in adj.get(u, []):
xs.append(v)
Tiny, single letter mutations are enough for evolution to explore vast landscapes. A demonstration using code, but the same mechanism is at play with DNA – a single amino-acid mutation can express an entirely different function.
Manav Rathi
Aug 2019
Aug 2019