commit d947844355268e0a4fca8fcd9d32fe36706e2294
parent 819d74fb0b2283882936115f085269d6a24a4e67
Author: mjkloeckner <martin.cachari@gmail.com>
Date: Fri, 27 Jan 2023 18:40:08 -0300
added example output
Diffstat:
M | README.md | | | 31 | ++++++++++++++++++++++++++----- |
1 file changed, 26 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
@@ -7,22 +7,43 @@ graph output to stdout formatted in
## Compiling and running
-```
+```shell
$ make -j $(nproc)
$ ./main
```
-## Generating a nice preview of the graph
+## Example output
-First make sure you have [graphiz]() package installed, then just pipe the
-output of the program to `dot`:
+This is the output when using the `graph_print` function:
+```shell
+strict graph G {
+ 1 -- {2, 5}
+ 2 -- {1, 3, 5}
+ 3 -- {2, 4}
+ 4 -- {3, 5, 6}
+ 5 -- {1, 2, 4}
+ 6 -- {4}
+}
```
+
+the output is formatted in dot language so it can be processed later by other
+tools. Another function exists `graph_print_format` which does the same as
+`graph_print` but adds graphviz attributes so it produces a nicer representation
+of the graph when parsed with
+[`dot`](https://graphviz.org/doc/info/command.html).
+
+## Generating a preview of the graph
+
+First make sure you have [graphiz](https://graphviz.org/) package installed,
+then just pipe the output of the program to `dot`:
+
+```shell
$ ./main | dot -T png -o out.png
```
this will generate a png file containing a nice representation of the graph. You
-can open it with you prefered image viewer.
+can open it with you preferred image viewer.
## License