UVA 10004: Bicoloring
Created at 2015-12-03T03:54:43.000Z

Problem definition: https://uva.onlinejudge.org/external/100/p10004.pdf

My implementation in Scala is here: https://github.com/hi-ogawa/algorithm_practice/blob/master/src/main/scala/net/hiogawa/algorithm_practice/uva/_10004.scala

What I learned/did

  • Introduction of Lens: definition, usage
  • Use BufferedIterator to look ahead Iterator: definition, usage
  • "Poorly" implemented Iteratee for intuitive stream processing: definition, usage
  • Use sealed abstract to define algebraic data type: usage
  • String interpolation: example
  • Convert several types of Scala functions vise versa: example
  • Access to test/resources directory: example
  • Make some specs2 examples pending:

Future Work

  • Each graph problem could be solved in parallell. Future could be it.
  • Think about more functional way everything is done one Iteratee without looking over like while (lines.head != "0")
  • Try using existing Iteratee library from play framework
  • Find useful existing graph library in scala