You are not logged in. Please login at www.codechef.com to post your questions!

×

LIGHTING - Editorial

PROBLEM LINKS

Practice
Contest

DIFFICULTY

HARD

EXPLANATION

Construct a bipartite graph in which one set of vertices corresponds to the rows and the other corresponds to the columns of the board. There is an edge from i to j if a[i,j] = 1. The problem asks to find the minimum edge coloring of the graph, i.e. to find the minimum number of colors to color the edges such that none of adjacent edges have the same color.

Minimum edge coloring in general graph is shown to be NP-hard, although an interesting result (Vizing's theorem) says that the minimum number of colors needed (or edge chromatic number) is either D or D+1, for D is the maximum degree of the graph.

However, on bipartite graph, minimum edge coloring is shown to be in P. A theorem by Konig says that in bipartite graph, edge chromatic number is equal to maximum degree. The theorem also suggests an O(VE) algorithm to find the minimum edge coloring.

A proof about Konig's theorem can be found here http://www.kurims.kyoto-u.ac.jp/~iwata/dmi/dmi01e.pdf. There is O(ElogE) time algorithm has been developed, for example http://ecommons.cornell.edu/handle/1813/6283. Some contestants manage to optimize the O(VE) to run into the time limit.

This question is marked "community wiki".

asked 28 Nov '12, 18:48

admin's gravatar image

0★admin ♦♦
15.9k347484508
accept rate: 35%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×11,596
×812
×12
×1

question asked: 28 Nov '12, 18:48

question was seen: 1,376 times

last updated: 28 Nov '12, 18:48