Niclas Alexandersson edited c) Solving as graph colouring.tex  almost 10 years ago

Commit id: aa3602ef56c48e931b64d3cd5b99164a88440056

deletions | additions      

       

\section{c) Solving as graph colouring}  We can easily convert the problem into a graph colouring problem, by treating each lecture as a node, and adding edges between all lectures which overlap, and therefore conflict with each other.  \begin{verbatim}  reduce_lsp(courses): 

for i in courses:  for j in courses:  if i /= j && isCollision(i, j)  edges.push( edges.add(  (i, j) ) return edges  \end{verbatim}