Import datalog

This commit is contained in:
Reid 'arrdem' McKenzie 2021-05-14 23:39:18 -06:00
commit 091e518a7e
18 changed files with 2510 additions and 0 deletions
projects/datalog

View file

@ -0,0 +1,25 @@
"""
For benchmarking the datalog.
Generates a large graph, which will be expensive to enumerate 2-edges over and paths through.
"""
from random import choice
from uuid import uuid4 as uuid
with open("graph.dtl", "w") as f:
nodes = []
# Generate 10k edges
for i in range(10000):
if nodes:
from_node = choice(nodes)
else:
from_node = uuid()
to_node = uuid()
nodes.append(to_node)
f.write(f"edge({str(from_node)!r}, {str(to_node)!r}).\n")