Q:

Forming sub-lists with pre-defined averages from an initial list

Say we have a list list = [1,2,3,4,5,6,7,8,9,10,11,12], a set of desired averages a=[2,5,8,11], and implicitly 4 groups that we want to form such that each group has a value of 2,5,8, and 11 respectively. Is this essentially a sorting problem? Is there a way to do this without checking each possible combination of sub-lists?
If the above version isn't actually tractable, suppose the goal is instead to form sub-lists by going through the above list in sequence. How does this make things easier?

A:

Given the problem, that you have, as suggested in the comment, k-means seems to be an appropriate choice for the algorithm.
You can implement your own version of k-means, or you can start from the implementation provided in scikit-learn, a package providing machine learning techniques, and specifically KMeans.
A possible implementation using scikit-learn starting with your example and with the plot is:
import matplotlib.pyplot as plt
import numpy as np
import sklearn.cluster

list1 = np.arange(1,13)
list1_y = np.array([1]*12)
a = np.array([2,5,8,11])
kmeans = sklearn.cluster.KMeans(n_clusters=a.shape[0],n_init=1,init=a.reshape((a.shape[0],1)))
kmeans.fit(list1.reshape((list1.shape[0],1)))
labels = kmeans.labels_
plt.scatter(list1, list1_y, c=labels.astype(np.float))
plt.show()

and the result of k-means that found 4 clusters is displayed in the following figure (each data point has a color, identifying the cluster they belong to) :

There are some aspects that you can look more in depth in order to understand how sklearn works:

The initialization of the class KMeans. I included just the relevant parameters, namely the number of clusters, coming from a, how many times it should try to perform an initialization, and the means of the initial clusters from a. There are other parameters that you can set.
The call of fit function to find the labels of each of the data in list1.
The reshape for accomodating the dataset for sklearn.

For more information about k-means, start looking at the related wikipedia page.

