diff --git a/man/rgbgfx.1 b/man/rgbgfx.1 index 42ada3f1..d93582d0 100644 --- a/man/rgbgfx.1 +++ b/man/rgbgfx.1 @@ -633,9 +633,10 @@ behavior depends on an internal detail of how the PNG is saved, specifically its chunk. Since few image editors (such as GIMP) expose that detail, this behavior is only kept for compatibility and should be considered deprecated. .Pp -It turns out that palette generation is an NP-complete problem, so +It turns out that palette generation is an NP-complete problem known as "pagination", so .Nm -does not attempt to find the optimal solution, but instead to find a good one in a reasonable amount of time. +does not attempt to find the optimal solution, but instead uses an "overload-and-remove" heuristic to find a good one in a reasonable amount of time. +(There are no guarantees about how this algorithm will generate palettes, apart from the constraints documented above.) It is possible to compute the optimal solution externally (using a solver, for example), and then provide it to .Nm via diff --git a/man/rgblink.1 b/man/rgblink.1 index b72a3faf..d073fc53 100644 --- a/man/rgblink.1 +++ b/man/rgblink.1 @@ -193,7 +193,10 @@ option! .El .Ss Scrambling algorithm The default section placement algorithm tries to place sections into as few banks as possible. -(It uses a variation of the "first-fit bin packing" algorithm to do so, although nothing is guaranteed about where it will place any particular section beyond the bank, address, and alignment constraints manually specified for the section.) +(It turns out that section placement is an NP-complete problem known as "bin packing", so +.Nm +does not attempt to find the optimal solution, but instead uses a "first-fit" heuristic to find a good one in a reasonable amount of time. +There are no guarantees about where this algorithm will place sections, apart from the bank, address, and alignment constraints manually specified for the sections.) .Pp .Dq Scrambling instead places sections into a given pool of banks, trying to minimize the number of sections sharing a given bank.