Live data from Hacker News

LaTeX Finite Automata and State Diagrams with Tikz

hayesall.com

11–20 of 36 posts

Re: LaTeX Finite Automata and State Diagrams with Tikz

#11
post #5

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?

Relevant search term: graph planarisation

Re: LaTeX Finite Automata and State Diagrams with Tikz

#12
post #2

I loved using Tikz for my Discrete Math homework. I was so proud of how pretty the DFA's looked :)

The TikZ style should really be the default standard or even the bottom line. Last time I check Google Slides still doesn't understand how to connect two blocks of texts. I have to manually choose among four points (north/south/west/east of a block) to start or end a line. Whereas in TikZ the optimal point (among infinitely many points that constituent the border) is chosen.

Re: LaTeX Finite Automata and State Diagrams with Tikz

#14

DFAs and NFAs may seem like academic novelties but they are amazingly powerful for certain problems. For example, naively searching a string of length N for P different substrings will yield an algorithm that has roughly O(N * P) worst case time complexity. But implementing that algorithm as a DFA yields an efficient construction that has O(N) worst case time complexity. This results in considerable speedups for comp…

> DFAs and NFAs may seem like academic novelties but they are amazingly powerful for certain problems.

They are the same thing as regular expressions. It's safe to say they're not being dismissed as academic novelties.

Re: LaTeX Finite Automata and State Diagrams with Tikz

#15

So 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?

I cannot disagree. I was a fan of pic in the past for its much superior (IMHO) syntax, but I also envied tikz beautiful results (for it's based on tex rather than troff).

I haven't looked at that field for a good while but I'm still genuinely interested. And so I'd like to better understand your comment. It is unclear to me whether you are arguing in favor of using another similar tool using a better syntax, or using an automatic graph layout engine, or a manual general purpose vector drawing tool. How would you recommend one to draw such diagrams?

Re: LaTeX Finite Automata and State Diagrams with Tikz

#17

So 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?

Cause it looks absolutely beautiful.

Re: LaTeX Finite Automata and State Diagrams with Tikz

#18

So 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?

Because those tools are well-known and they allow people to get the result they want. They also can be used for other things and are not specific to a particular kind of drawing.

Tikz also allows a tight integration to LaTeX documents that no external tools achieve so easily. The drawing inherits colors and fonts, and bits can be reused across the document and can be shared with other documents too.

High learning curve but long term efficiency with quality results.

Tikz is not perfect but it has the great characteristic of existing.

Re: LaTeX Finite Automata and State Diagrams with Tikz

#19
post #5

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?

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

#20
One 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".

Post reply on HN