Is that a homework assignement ?
If not, it is a dynamic programming problem. To see it, you should transform your problem into the following one using your example as a base. You are at the start. You may choose either one of {1,2,3,4}. From there you may choose to go to {1,2,3,4}. Do this 4 time and you have all the arrangement of length 4 of the list {1,2,3,4}.
Now you need a cost function, which is defined as:
f(prev, next) = prev ^ next
= 0 if the solution is not valid for your original problem
= 0 if prev is the start
The total cost is expressed as
cost(i|a|X) = min(i in {1,2,3,4}, f(i, a) + cost(X))
note that i|a|X
represent a list starting with an element a and then i and the rest of the list is X.
Looking at the cost
function you should recognize the dynamic programing.
From there you may derive an algorithm. Look at wikipedia for an introduction to dynamic programming.
My Scheme implementation which you can test with PLT Scheme is:
(define (cost lst f)
(if (null? lst)
0
(let ((h (car lst))
(t (cdr lst)))
(if (null? t)
0
(+ (f h (car t))
(cost t f))))))
(define (solve lst f)
(let loop ((s '()))
(if (= (length s) (length lst))
s
(loop
(let choose ((candidate lst)
(optimal #f)
(optimal-cost #f))
(if (null? candidate)
optimal
(let ((c (car candidate)))
(if (memq c s)
(choose (cdr candidate) optimal optimal-cost)
(if (not optimal)
(choose (cdr candidate) (cons c s) (cost (cons c s) f))
(if (<= (cost (cons c s) f)
(cost optimal f))
(choose (cdr candidate) (cons c s) (cost (cons c s) f))
(choose (cdr candidate) optimal optimal-cost)))))))))))
Then calling (solve '(1 2 3 4) expt)
yields another minimal solution '(3 2 1 4).