• qwertox 3 hours ago

    I was expecting some pretty, colored graphs, but the book is in black and white.

    From Wikipedia [0]:

    In graph theory, graph coloring is a special case of graph labeling; it is an assignment of labels traditionally called "colors" to elements of a graph subject to certain constraints.

    [0] https://en.wikipedia.org/wiki/Graph_coloring

    • motohagiography 3 hours ago

      it makes more sense in the applications, asking AI, you get examples like how to schedule exams so that no student has a conflict, scheduling flight crews, radio frequency assignment to avoid overlap. e.g. "By representing flights as vertices and connecting edges between flights that share crew members, a coloring algorithm assigns crews to flights to minimize conflicts"

      • throwaway290 an hour ago

        If you think you must ask AI for this, wait till you learn Wikipedia article you replied on says just that but with more sourced detail and less possibility for accidental falsehood

      • madcaptenor 3 hours ago

        I'm surprised too, especially given that this seems primarily intended as a book to read online so the extra printing costs for color wouldn't be an issue. I imagine there are some places in the book where there are large numbers of "colors" and so it wouldn't be helpful to show them as actual colors - but surely there are some places where actual colors would be useful.

      • n4r9 4 hours ago

        This looks like a nice book. I took courses in graph theory and ramsey theory at university many years ago. Reading the first couple of pages of the first chapter, it's pitched at a good level for me to jump back into things.

        Users might find this paragraph from the Preface helpful:

        > This book is about graph coloring, one of the most popular and widely-studied areas of discrete mathematics. The intended reader is a graduate student or early career researcher, although it should be useful for readers who are both less and more experienced. The reader may find it useful to have taken a 1-semester course in graph theory, but this is not strictly necessary. My goal as the author is to help you understand, internalize, and add to (if you like) central results in many areas of graph coloring.

        The first chapter also states:

        > In this book we focus on the existence of colorings, rather than on algorithms to produce them

        Does anyone know of resources for learning or implementing algorithms for graph colouring?

        • HarHarVeryFunny 3 hours ago

          With so many methods, it'd be interesting to get some feel for what percentage of random graphs, or graphs of a particular type perhaps, can be optimally colored using each technique.

          The subject reminds me of a YACC-like parser generator I wrote back in the early 80's... Using graph coloring to compress the parser tables.

          My generator was more general than YACC, accepting LR(1) grammars rather than LALR(1) ones, a feat which was considered impractical at that time (said Aho & Ullman's "dragon book"). Certainly a canonical Knuth parser would be huge, but what made it possible was to use an at the time obscure state-combining technique invented by Prof. Pager. However, the resulting parse tables (2-D array, indexed by parser state and current symbol) were still huge, although sparse. One solution was to represent the tables as linked lists, but I wanted to instead compress them to keep the speed of array access.

          The solution I used was to convert the sparse 2-D array to a graph, color the graph, then convert it back to a compressed array where non-conflicting (sparse) rows and columns had been combined.

          The idea was to:

          1) Convert each row of the 2-D array to a graph node, and connect that node to all other nodes who's corresponding row had a conflicting column entry.

          2) Color the resulting graph (i.e. assign colors to nodes, such that connected nodes have different colors, using fewest possible colors). The simple but effective coloring heuristic I used was just to assign colors to the "hardest" (i.e. most constrained) nodes first - those with the most connections.

          3) Convert the colored graph back to a 2-D array by combining all rows (nodes) of the same color, which by construction meant rows not having any conflicting entries would be combined, and the array would be compressed in accordance to how few colors had been used.

          4) Repeat steps 1-3 for the columns.

          What I liked about this algorithm was that any future research into optimal graph coloring could be applied to it to achieve better compression, although this was just a side project and I never did revisit it.

          The resulting parsers (I implemented both K&R C and Modula-2) were indeed stupid fast due to just using array access. I don't remember how big the compressed tables were for these languages, but they happily ran on the Acorn 32016 2nd processor I was using for development (I did this while working for Acorn Computers).

          Incidentally, the "do the hardest/most-constrained bits first" is a useful heuristic for many problems - e.g. I remember also using it so solve the "knight's tour" chessboard problem (have a knight visit each square on a chessboard exactly once).

          • datadrivenangel 3 hours ago

            "More precisely, it is NP-hard1. So it is unlikely that we will find an efficient algorithm to optimally solve the coloring problem on an arbitrary input graph. This fundamental hardness result casts a long shadow across the landscape of graph coloring."

            • HarHarVeryFunny 3 hours ago

              Yes, but in practice heuristic approaches can work well, even if there are no guarantees of optimality. See for example my response about a simple "most constrained first" heuristic.