I find manually laying out graphs and digraphs tedious. It seems like a problem that should be amenable to machine learning approaches. Basically, training a machine as to what is an aesthetically pleasing layout and what is not. Are there layout engines that use machine learning for layout, as against being implemented in terms of specific tree or graph layout algorithms?
LaTeX Finite Automata and State Diagrams with Tikz
21–30 of 36 posts
Re: LaTeX Finite Automata and State Diagrams with Tikz
#22I find manually laying out graphs and digraphs tedious. It seems like a problem that should be amenable to machine learning approaches. Basically, training a machine as to what is an aesthetically pleasing layout and what is not. Are there layout engines that use machine learning for layout, as against being implemented in terms of specific tree or graph layout algorithms?
I don't think the difficulty in making diagrams has to do creating a layout that is aesthetically pleasing, but rather with expressing ideas visually in a way that others can understand them. I'm sceptical that AI can help with that.
Re: LaTeX Finite Automata and State Diagrams with Tikz
#23So repulsed by this. Learning custom DSL with opaque semantics that will leave you scratching your head when something goes wrong and tool behaves not like you expect. Why people opt into such tools at all?
Re: LaTeX Finite Automata and State Diagrams with Tikz
#24I loved using Tikz for my Discrete Math homework. I was so proud of how pretty the DFA's looked :)
I used OmniGraffle and got some pretty fine looking graphs myself, but this is next-level ease. I’m jealous that you knew how to use this.
Re: LaTeX Finite Automata and State Diagrams with Tikz
#25So repulsed by this. Learning custom DSL with opaque semantics that will leave you scratching your head when something goes wrong and tool behaves not like you expect. Why people opt into such tools at all?
E.g. in my theses all figures (except one in my first thesis) were made with TiKZ with colors and definitions defined in a file that is "imported" during compilation.
This allowed me to fine tune various parts (colors, ...) without having to touch each figure again. Also, all the data files are stored as CSV and read/processed by LaTeX. Between handing in my thesis and publishing the short-paper version of it for a conference I could rerun my analysis (to include the most recent data) with a single command and then just recompile the document to have all figures updated.
The thesis: https://www.ac.tuwien.ac.at/files/pub/hinteregger_18.pdf
And TikZ graphics play somewhat nice with the beamer package. I found it easier to define transitions in technical figures with TikZ/beamer than with PowerPoint or any other tool so far.
In a summer internship I worked on the documentation of a project that tried to optimize pillar-placement for skilifts. This was very Math/Physics heavy.
With TikZ I could define various parts (e.g. pillar, rope, gondola) as "function" and then create figures that combined these parts.
I.e: - place pillars at these locations - connect them with ropes obeying some formula - put gondolas along the rope with some defined distance
Important points where marked with coordinates automatically, allowing explanatory nodes (text box with arrow or paths with labels) to be added (with full LaTeX support).
Re: LaTeX Finite Automata and State Diagrams with Tikz
#26One of the elephants in the room of laying out node-arc diagrams is just how bad Graphviz is at the task. This sort of thing should be a core use case for Graphviz and it just isn't a good tool. If anyone writes a Graphviz tutorial, it would be doing the world a service to prefix it with "But seriously, note that Tikz exists".
I have a Theory of Computation text so I have many, many such diagrams. I don't rely on the graphviz output directly. If I have to make a graph where the layout isn't obvious then I write a .dot file and run it through graphviz, specifically, neato. I use that as a model for drawing it with a LaTeX tool (I don't use TikZ, I use Asymptote, but the point is the same). That way I get a pretty good layout, better then I personally could do without the guidance from graphviz, and a visual consistency to the diagrams.
Re: LaTeX Finite Automata and State Diagrams with Tikz
#27I find manually laying out graphs and digraphs tedious. It seems like a problem that should be amenable to machine learning approaches. Basically, training a machine as to what is an aesthetically pleasing layout and what is not. Are there layout engines that use machine learning for layout, as against being implemented in terms of specific tree or graph layout algorithms?
It would be nice if there were a tool that would take the input to graphviz, run it to graphviz to get the layout and then use that to generate the tikz code using that layout.
Re: LaTeX Finite Automata and State Diagrams with Tikz
#28On this topic, I recently came across a nice string diagram formalization for automata: https://arxiv.org/pdf/2009.14576.pdf
If I understand correctly, their work makes diagrams and code isomorphic. Meaning roundtripping between diagrams and code can be done with no loss, no impedance mismatch.
Meaning my long-time dream of a two-way structure editor is now feasible. Edit the diagram, the code updates. Edit the code, the diagram updates. Back and forth.
As you know, the Achilles Heel of CASE tools (and visual programming) has been the inability to roundtrip.
Do I understand correctly?
My science-fu is weak. I've been struggling to wrap my head around grammars and whatnot my entire career. Please forgive.
Re: LaTeX Finite Automata and State Diagrams with Tikz
#29Also, has anybody tried using Inkscape [1,2] or another vector drawing tool for this? I imagine it would be faster and more intuitive than learning Tikz.
[1] - https://stackoverflow.com/questions/17610717/drawing-an-undi...
[2] - The following appears to be part of a presentation: https://gould.cx/ted/presentations/txlf16/Technical%20Drawin...
Re: LaTeX Finite Automata and State Diagrams with Tikz
#30I find manually laying out graphs and digraphs tedious. It seems like a problem that should be amenable to machine learning approaches. Basically, training a machine as to what is an aesthetically pleasing layout and what is not. Are there layout engines that use machine learning for layout, as against being implemented in terms of specific tree or graph layout algorithms?
[1] https://tikz.dev/gd-overview
edit: chapter 27 in the online version