Jump to content

Coder Battle #4 Graph Coloring

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
78 replies to this topic

#1
Vswe

Vswe

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 9,552 posts
Welcome to the 4th official Coder Battle! If you haven't seen them, please take a look at the Coder Battle Rules.

The Problem
This task will test a common computer science problem: graph coloring! Specifically, you'll be completing Project Euler problem 189 with some changes:


  • The program should accept input of the number of rows for which to calculate the number of colorings for.
  • As an extension, and for extra credit, you can also allow the number of colors to be changed too.
We should also clarify the meaning of one of the paragraphs in the problem:


Quote

Originally Posted by Problem #189
A colouring C' which is obtained from a colouring C by rotation or reflection is considered distinct from C unless the two are identical.
Basically, you can rotate solutions to obtain other solutions. In general, if the wording is causing problems feel free to ask!

Judging
The judges for this problem will be Vswe and PythonPower. We're looking for correctness, quality of code and efficient algorithms.

Does your solution solve the problem? Can we find a case where it fails? Can it solve extreme cases quickly? Are variables name consistently? Is there redundant code or inelegant methods? Questions like these will form the process for selecting the winner.

Submissions
Send your submissions by mail to us at: CC_BattleJudges@hotmail.com before the 16th of june to join the 4th version of CodeCall's Coder Battle.

Rewards
We'll announce first, second and third place. I'm sure a few administrators/ moderators can see to some serious +rep for those people. ;)

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Very cool! Nice work, and fast! I thought there would be three judges?

Posted via CodeCall Mobile

#3
ShadenSmith

ShadenSmith

    Newbie

  • Members
  • PipPip
  • 19 posts
When considering the number of colors used, must each color be used? For example, when calculating three colors, do we need to account for the cases in which only two colors are used?

Edited by ShadenSmith, 02 June 2009 - 05:10 PM.
typo


#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Clarification: would the 64 triangle example be considered 8 rows?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#5
Vswe

Vswe

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 9,552 posts

Jordan said:

Very cool! Nice work, and fast! I thought there would be three judges?

Posted via CodeCall Mobile

Now it's only me and PythonPower, you left us.

ShadenSmith said:

When considering the number of colors used, must each color be used? For example, when calculating three colors, do we need to account for the cases in which only two colors are used?

Problem 189 said:

We wish to colour the interior of each triangle with one of three colours: red, green or blue, so that no two neighbouring triangles have the same colour.

Accourding to this you know that each triangle can have one of 3 colors, not that all colors need to be used.


WingedPanther said:

Clarification: would the 64 triangle example be considered 8 rows?

The triangles should be in the same shape as in the example:

1 triangle = 1 row
4 triangles = 2 rows
9 triangles = 3 rows
16 triangles = 4 rows
25 triangles = 5 rows
etc.

#6
Turk4n

Turk4n

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 3,847 posts
This looks kinda fun. I will try to join in and do something :>
Posted Image

#7
ArekBulski

ArekBulski

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,376 posts
I will join the Battle using Visual Studio 2008. C# Edition. :)

Can I upload a built solution with speedyshare.com and then email you a link? Gmail has too strict restrictions, no exes and about 25 megs in size I think.

Edited by ArekBulski, 03 June 2009 - 04:59 AM.


#8
PythonPower

PythonPower

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 230 posts
Sure, that's fine!

Reminder to everyone: Don't forget to tell us who you are in your email to us! ;)

#9
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
ill be in this one too
ill use JAVASCRIPT, yeah i said javascript :D with mootools
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript

#10
Bercikos

Bercikos

    Newbie

  • Members
  • PipPip
  • 11 posts
I'll join to this contest too, and I'll use Visual c# Studio 2008.

#11
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
C++... tell me you're shocked!
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#12
ArekBulski

ArekBulski

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,376 posts
I am shocked, Winged!!! Honestly, I was "afraid" that you will join. Now I have a really hard competition. ;)