Skip to content

Instantly share code, notes, and snippets.

@cheftako
cheftako / convert.rb
Created September 14, 2011 22:12
Script to convert 3CNF_Sat problems in to 3 colorability problems.
#!/usr/bin/ruby -w
# Please see http://engineering.linkedin.com/49/linkedin-coding-competitions-graph-coloring-haskell-c-and-java for background
$variableHash = Hash.new
class Clause
def initialize (input, name)
inputArray = input.split('|')
@varANegated = inputArray[0][0,1] == "!"