forked from caten/DiscreteNeuralNets
23 lines
1 KiB
Python
23 lines
1 KiB
Python
"""
|
|
Tests for creating the files used by dominion polymorphisms
|
|
"""
|
|
import src
|
|
from dominion_setup import grow_forest, build_dominions, find_homomorphisms
|
|
|
|
print('Grow a forest file consisting of trees that we will use as constraint graphs.')
|
|
print('We\'ll make 10 tress, each with 100 nodes.')
|
|
grow_forest('forest', 10, 100)
|
|
print()
|
|
|
|
print('Create dominions with random trees from this collection.')
|
|
# If we're going to use these dominions to create polymorphisms, then we need to have the size be one more than the
|
|
# maximum possible Hamming weight for a given universe size for binary relations. Say our universe has 28 members.
|
|
# The number of possible values the Hamming weight can take on is 28*28+1=785.
|
|
print('We\'ll create 20 dominions, each of size 785. That is, universe size 28.')
|
|
build_dominions('forest', 'dominions', 20, 785)
|
|
print()
|
|
|
|
print('Find homomorphisms from the trees we created to the Hamming graph.')
|
|
print('We\'ll find one homomorphism for each tree we created, for the universe size 28.')
|
|
find_homomorphisms('forest', 'homomorphisms', 28)
|