Project Euler #189: Tri-colouring a triangular grid

  • + 0 comments

    This can be solved by using chromatic polynomials and using deletion contraction algorithm. Memoization is necessary as we count polynomial for the same graph many times. In order it to work I had to represent graph in a very consice way as string is used as a key to cache and must as short as possible. By no means this is an easy task. Should be at least marked as hard.