CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2010
    Posts
    4

    Algorithm solution

    Hi all,

    I got a problem to solve - hope anyone can help...

    We have 6 circles. Each circle splited into 8 slices. Each slice has its own color.

    I should build a peramide in the following structure:

    o
    oo
    ooo

    With the following condition:
    The color of touching slices must be identical

    The output should be arrangment according to the root colors (it changes when I rotate the root).


    Thanks!

  2. #2
    Join Date
    Sep 2010
    Posts
    4

    Re: Algorithm solution

    The pyramid structure should be (ignore the dash):
    ---o
    --oo
    -ooo

  3. #3
    Join Date
    Sep 2010
    Posts
    4

    Re: Algorithm solution

    Last chance...

    ---0
    --00
    -000

  4. #4
    Join Date
    Sep 2010
    Posts
    4

    Re: Algorithm solution

    It must be symmetrical

  5. #5
    Join Date
    Jul 2005
    Location
    Netherlands
    Posts
    2,042

    Re: Algorithm solution

    Quote Originally Posted by liel2010 View Post
    We have 6 circles. Each circle splited into 8 slices. Each slice has its own color.

    With the following condition:
    The color of touching slices must be identical

    The output should be arrangment according to the root colors (it changes when I rotate the root).
    Seems trivial if each slice has a unique color.

    Look into graph coloring algorithms. You can represent the pyramid as a graph where each slice is a vertex and adjacent slices are connected by an edge. Your exact problem seems somewhat different from graph coloring, but it is quite similar.
    Cheers, D Drmmr

    Please put [code][/code] tags around your code to preserve indentation and make it more readable.

    As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured