Algorithm for sorting with constraints I've got 30 elements which has to be  grouped/sorted into 10 ordered 3-tuple. 
There are several rules and constraints about grouping/sorting.
For example: Element $A$ must not be in the same tuple same unit $B$. 
Element $C$ must not be right in front of element $A$, etc.

I am searching for an approximated algorithm:


We don't need to achieve the exact optimum 
It is OK for some rules not to be satisfied, if it helps to fulfill more rules.


Do you know of any algorithm/proceeding that solve this problem or a similar one?
I fear to solve it in an optimal way, you have to try out every possible solution-> $2 ^ {30}$

EDIT: Sorry for the bad explanation. I am trying to make it a bit clearer:
I got 30 elements for example: $\{1,2,3,\ldots,30\}$.
I need to group them into 3-tuples so that i get something like: $(1,2,3)$, $(4,5,6)$,$\ldots$,$(28,29,30)$.

There are several constraints. For example: 


1 cannot precede 2 in an ordered tuple, so, for instance  $(1,2,3)$ is not a valid tuple.
5 must be together with 4. 


Those constraints can be broken and its possible that there is no solution where all rules can be fulfilled. An solution is considered as good if the amount of rules broken is "low".

Hope that makes it clearer and thanks for the help so far.
The question of whether we can solve this problem without violating any rules is a set cover problem.

In particular, the universe is $U=\{1,2,\dots,30\}$, and each possible tuple $t_i$ that follows all the rules corresponds to a set $S_i \subseteq U$.  In this way, we get many sets $S_1,S_2,\dots,S_n$.  We want to know whether there is some 10 of these sets whose union is all of $U$.  That's the set cover problem.  There are well-known hardness results and approximation algorithms for the set cover problem.



Now let's introduce the opportunity to violate some of the rules.  Associate to each tuple $t_i$ a cost $c_i$.  If the tuple $t_i$ follows all the rules, there is no cost for using that tuple: $c_i=0$.  If the tuple $t_i$ violates some of the rules, we'll set $c_i$ to denote the cost of those violations (for instance, if each rule that is violated costs \$1, then $c_i$ can be set accordingly).  In this way we get a collection of sets $S_1,S_2,\dots,S_n$ with associated costs $c_1,c_2,\dots,c_n$ for each of them.

Now our goal is to find some 10 of those sets whose union is $U$, and where the sum of their costs is minimized.

This can be formulated as an integer linear program (ILP).  In particular, we'll introduce $n$ integer variables $x_i$; the intended meaning is that $x_i=1$ means that $S_i$ is one of the 10 sets that were selected, and $x_i=0$ means $S_i$ was not selected.  Now we want to minimize

$$\sum_i c_i x_i,$$

subject to the constraints

$$\sum_{j \in S_i} x_i \ge 1 \text{ for each $j=1,2,\dots,30$}$$

(where the sum is over all $i$ such that $j \in S_i$) and $0 \le x_i \le 1$.  Now you could throw any ILP solver at this problem and see what solution it turns up.