Algorithm solution
 CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

1. Junior Member
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. Junior Member
Join Date
Sep 2010
Posts
4

## Re: Algorithm solution

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

3. Junior Member
Join Date
Sep 2010
Posts
4

## Re: Algorithm solution

Last chance...

---0
--00
-000

4. Junior Member
Join Date
Sep 2010
Posts
4

## Re: Algorithm solution

It must be symmetrical

5. ## Re: Algorithm solution

Originally Posted by liel2010
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.

#### Posting Permissions

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