Anders and Briegel in Python
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8 jaren geleden
8 jaren geleden
8 jaren geleden
8 jaren geleden
8 jaren geleden
8 jaren geleden
8 jaren geleden
8 jaren geleden
8 jaren geleden
1234567891011121314151617181920212223242526
  1. from matplotlib import pyplot as plt
  2. from graph import *
  3. from viz import draw
  4. def local_complementation(g, vops, v):
  5. for i in g[v]:
  6. for j in g[v]:
  7. if i<j:
  8. toggle_edge(g, i, j)
  9. # vops[i] = times_table[vop[i]][sqrtmiz]
  10. # vops[v] = times_table[vop[v]][sqrtix]
  11. if __name__ == '__main__':
  12. g, vops = graph(10)
  13. add_edge(g, 0, 1)
  14. add_edge(g, 1, 3)
  15. add_edge(g, 3, 2)
  16. add_edge(g, 3, 0)
  17. add_edge(g, 2, 0)
  18. add_edge(g, 0, 5)
  19. vops[0]=1
  20. draw(g, vops)
  21. plt.clf()
  22. local_complementation(g, vops, 0)
  23. draw(g, vops, "out2.pdf")