The first step in updating the solver was changing it so it will modify only some of the parameters that are passed to it. In the old version, it changed all the parameters so that the difference for each coordinate was minimal. Now we'll specify which points can be changed and which not. The solve method will have one additional parameter, which will hold the number of free points, and the parameters list will be sorted to have the free points first.
The changes for the solve method are complete, and now I'm updating the ReferingNode method to use a generic way of correctly ordering the parameters and determining the number of free points.