I have x guests for my wedding and y tables with z seats. Guest A can sit on the same table as guest B and guest C can not sit on the same table as guest D, ....
Given
If you require an exact solution, formulate it as an 0-1 integer program and use GLPK to solve it.
Let x_ij be 1 if person i is assigned to table j and 0 otherwise. Consider the following constraint set:
(i) sum_{j=1...y} x_ij = 1 for i=1...x
(ii) sum_{i=1...x} x_ij <= z for j=1...y
(iii) x_ij + x_kj <=1 for j=1...y
(iv) x_ij is binary
Constraints (i) make sure everyone is assigned. Constraints (ii) prevents overloading a table. Constraints (iii) are defined for each person pair (i,k) that can't sit together.
Plug it into GLPK, CPLEX, or GUROBI and you're in business, provided that the problem is not too large. As the others have mentioned, NP-hardness means things could get ugly.