Complexity of SVG

By Xah Lee. Date: .

The unsolvable combinatorial Complexity of SVG format.

Oh gawd, i used to love SVG, cause it's simple and human readable. But svg has the same problem with HTML. That is, when it is machine generated, such as by inkscape, the result is incomprehensible complex chaotic faak.

Been working on manually simplifying a SVG file of keyboard diagram. Took 3 hours.

svg verbose 2020-04-04 5d6z6
svg verbose 2020-04-04
svg verbose 2020-04-04 vp5d6
svg verbose 2020-04-04

I think it is in general not possible to solve this problem. Because, you run into combinatorial problems.

For example, in HTML, if you want to bold a link text, there are many ways. Example:

<a href="xyz.html"><b>xyz</b></a>

<b><a href="xyz.html">xyz</a></b>

<a style="font-weight:bold" href="xyz.html">xyz</a>

<a class="boldIt" href="xyz.html">xyz</a>

<a id="bold17200" href="xyz.html">xyz</a>

<a href="xyz.html"><span class="boldIt">xyz</span></a>

<a href="xyz.html"><span id="bold17200">xyz</span></a>

<a href="xyz.html"><span style="font-weight:bold">xyz</span></a>

and many tags can be combined in such flexible way. Also, there are many ways to do a specific look via CSS style. Also, for example, line break, can be done in many different ways.