From 3d81dc667dbb8fa5fccc194e78bea3099b45da43 Mon Sep 17 00:00:00 2001 From: Florian Stecker Date: Wed, 4 Jan 2023 22:58:15 +0100 Subject: [PATCH] add example to documentation --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index ef6ecba..c3eb9a8 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,20 @@ What this program can do is produce these two automata, not only for the equilat See `example.py`. The function `generate_automaton_coxeter_matrix` takes as argument the [Coxeter matrix] of the desired group and a boolean determining which of the two automata is generated. It returns the automaton as an adjacency list. In addition, the function `enumerate_group` can compute all group elements up to a given word length, including the edges of the Cayley graph. To do this, it uses both automata. +For example, the following code would give us the first of the two automata above: + + #!/usr/bin/python + + import coxeter_automaton + + coxeter_matrix = [[1, 3, 3], + [3, 1, 3], + [3, 3, 1]] + + graph = coxeter_automaton.generate_automaton_coxeter_matrix(coxeter_matrix, lex_reduced = False) + + print(graph) + For a more human-readable output, `dot_graph.py` generates dot files, which can be used as input to [Graphviz] to render the graph as a PDF file. The resulting images are not quite as nice as the manually drawn ones above, but usually good enough to be useful. [Brink-Howlett]: https://link.springer.com/article/10.1007/BF01445101