Skip to content
Snippets Groups Projects
  1. Dec 20, 2012
  2. Dec 19, 2012
  3. Dec 18, 2012
  4. Dec 17, 2012
  5. Dec 14, 2012
  6. Dec 12, 2012
  7. Dec 11, 2012
  8. Dec 07, 2012
  9. Dec 06, 2012
  10. Dec 05, 2012
  11. Dec 04, 2012
    • Guido Trotter's avatar
      Add "proper coloring" unittest check · c94f9990
      Guido Trotter authored
      
      We have to check that for each edge its vertices have different colors.
      
      This is very easy to do with a vertex-to-color map, but not so easy with
      a color-to-vertex one. Since all our coloring algorithms created a
      vertex-to-color map behind the scenes and then converted it, we flip
      them back to returning it directly, and do the conversion explicitly
      where we need it (which for now is everywhere except when testing this
      property).
      
      Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
      Reviewed-by: default avatarIustin Pop <iustin@google.com>
      c94f9990
    • Guido Trotter's avatar
      Fix Dsatur and add Dcolor · 8b50de5c
      Guido Trotter authored
      
      Our Dsatur implementation was incorrect: while the paper defined the
      degree of saturation of a vertex as the number of different colors it is
      adjacent to, we were using the number of colors, without considering
      uniqueness. This effectively implemented a different algorithm, which is
      very similar to the previous one, and while it performs slightly worse
      on average it still beats Dsatur on some cases.
      
      So we refactor the implementation to effectively support both algorithms
      without code duplication, and then we export both the old algorithms as
      "Dcolor" and the new one as "Dsatur". Since these are all fast
      algorithms in hroller we will still be able to pick the best result.
      
      Note that the new Dsatur implementation uses an IntSet to calculate the
      uniqueness. Results with nub + length on a list were significantly
      slower.
      
      Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
      Reviewed-by: default avatarIustin Pop <iustin@google.com>
      8b50de5c
Loading