# i need help with this question:

This is a discussion on i need help with this question: within the C Programming forums, part of the General Programming Boards category; If there were an odd number of ambassadors, I don't think it is deterministically possible (in the worst case). Would ...

1. If there were an odd number of ambassadors, I don't think it is deterministically possible (in the worst case). Would anyone care to debate that point?
Maybe there is also an ambassador that doesn't hate anyone in that case, as long as we are changing the problem statement. Then, it should be possible.

2. Whiteflags,

I think that you're on to something with that. Since, according to Dossey, et. al. Theorem 3.9: "The chromatic number of a graph G cannot exceed one more than the maximum of the degrees of the vertices of G." So for any graph, in the questions' proposition, of ambassadors the chromatic number is n. Meaning that it would take at most n ambassadors, to "color" the seats without sitting next to an ambassador of a different color (?). Obviously, 2n - (n-1) = n+1. One extra for the round table, because the end points are adjacent.

I was concerned about the behavior of the matching algorithm for the "garbage-in garbage-out" principle. If I specify an even number, but exceed the maximum no. of enemies the loop runs indefinitely.

Using these inputs for example:

Code:
```\$ ./a.exe
4
1	2	3
2	1
3	1
<Ctrl-D>```
The same is true if I supply 2n-1 (an odd number) as the number of ambassadors, and ceiling((2n-1)/2) - 1 enemies:

Code:
```\$ ./a.exe
3
1	2
<Ctrl-D>```
So I've added a function to validate that the degree of any given vertex in the constraint list is within the boundaries:

Code:
`int validateAdjacency( int **mat, int rows, int columns, int max_degree );`
If the validation fails, one could add another (how many) ambassador(s) to the table. Like sentinels that aren't actually representatives and have no enemies. It would change the size of the seating chart, but leave the enemy graph unchanged.... I was less concerned with changing the problem statement, than with adapting the solution to the possible inputs.

Does that sound right? The proof seems a little stilted, any tips?

Best Regards,

New Ink -- Henry

Page 2 of 2 First 12