finding possible ordering set of vector
hello
I want to do some reordering of elements in a vector (vect_temp) according to criteria:
after finding the first element I need to find the next element after calling functions
Min_diff(vect_temp);
nex_minr(vect_temp,next_point);
the first function will generate the vector (vect_diff) of possible elements and also the second function will find vector ( vect_min) of elements
if element in the (vect_diff) is equal to the element in ( vect_min) then add this element into the ordered set with this equal element and continue ordering of complete vector vect(temp)
the problem is sometimes that many elements in vect_diff sometimes equal elements in vect_min so that I want to generate all possible ordering
I did the code that finds first equal element and continue ordering but the prolem is that I have sometimes muliple equal elements I don't know how to generate the solutions for the other multiple element
[code]
for (int y=0; y< vector_temp.size(); y++){
Min_diff(vect_temp);
nex_minr(vect_temp,next_point);
for (int i=0; i< vect_diff.size(); i++){
String element_min= vect_diff.get(i).toString();
if( vect_min.contains(element_min)){
vec_ordering.add(element_min);
_2nd_min_element= element_min;
vec_temp.removeElement(next_point);
next_point=_2nd_min_element;
i= vect_diff.size();
}// end if condition
} // end for (i)loop
}// end for (y) loop
[\code]
as I said before I don't have problem in finding first element or next element I just want to find all possible ordering set because at each time there is multiple element in vec_diff equal to multiple elements in vec_min I want to find all solutions for example first solution with first element in vec_diff equal to element in vec_min and second solution with second equal element and so on
I hope that I find solution to my problem
thanks alot