<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "how to find all solutions for reordering of vector "]]></title>
		<link>http://forums.hotjoe.com/posts/list/3.page</link>
		<description><![CDATA[Latest messages posted in the topic "how to find all solutions for reordering of vector "]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>how to find all solutions for reordering of vector </title>
				<description><![CDATA[ hello everyone<br /> -I have problem in finding all possible solutions for reordering of vector.<br /> <br /> -I have vector named (vect_temp) and I want to find all possible reordering of this vector.<br /> <br /> -I have function named Min_diff(vect_temp,next_point) works as follows : I should gave it an element (next_point) in the vector (vect_temp) and it must generate the vector (vect_diff) that contains all possible elements next elements.<br /> <br /> -The function nex_min(vect_temp,next_point) works as follows : I should gave it an element (next_point) in the vector (vect_temp) and it must generate the vector  (vect_min) that contains all possible elements next elements.<br />  <br /> -reordering critriea:<br /> -Min_diff(vect_temp,next_point)  and nex_min(vect_temp,next_point) and (next_point) in this first iteration is equal to any selected element in the (vect_temp). after calling the functions,  if element in the (vect_diff) is equal to the element in ( vect_min) then add this element into the ordered set [ vec_ordering] and call functions Min_diff(vect_temp,next_point)  and nex_min(vect_temp,next_point) again ,  next_point now is the equal to the element that we have been added in the previous step into the ordered set [ vec_ordering] and repeat this process until all elements in (vect_temp) are ordered according to this criteria.<br /> <br /> - I'm able to do reordering according to the cirtira above and find one solution. but the problem is that if (vect_diff) contains many elements that equal to many elements in ( vect_min), in this case I need to do reordering for the first equal element and this will be one solution and then find reordering for the next equal element and so on.<br /> <br /> let's consider this example:<br /> - let (vect_temp) contains element [5,9,7,3,1]<br /> - for the firs iteration let the next_point equal to 7<br /> - after calling function Min_diff(vect_temp,next_point), then (vect_diff) will contain [ 5,9,3]<br /> - after calling function nex_min(vect_temp,next_point), then ( vect_min) will contain [ 5,9]<br /> so for now (vect_diff) and ( vect_min) will have two equal elements.<br /> - the first solution must be that fist take the first equal element and do reordering such that ordered set [ vec_ordering] will equal to [7,5] then call functions Min_diff(vect_temp,next_point),  and  nex_min(vect_temp,next_point) again. the( next_point) in this iteration is qual to 5, these funtions will find next elements, let's consider that (vect_diff) and ( vect_min) will have equal element [3] then add this element to the ordered set [ vec_ordering] and repeat calling functions util all elments in (vect_temp) are added to the ordered set [ vec_ordering]. This will be one solution. now the second solution will be is to take second equal elment [9] instead of [5]  and continue calling functions and finding ordered list.<br /> so that each time vect_diff and vect_min will have many equal elements, then do reordering for first equal element this is one solution and then do reordering for the second equal element and so on.<br /> <br /> -my code that can only find one solution that takes only first equal element in (vect_diff) and ( vect_min) and continue ordering is below<br /> [code]<br /> for (int y = 0; y &lt; vect_temp.size(); y++) {<br /> 	Min_diff(vect_temp);<br /> 	nex_min(vect_temp, next_point);<br />     for (int i = 0; i &lt; vect_diff.size(); i++) {<br /> 	String element_min = vect_diff.get(i).toString();<br /> 	if (vect_min.contains(element_min)) {<br /> 	  vec_ordering.add(element_min);<br /> 	_2nd_min_element = element_min;<br /> 	 vec_temp.removeElement(next_point);<br /> 	 next_point = _2nd_min_element;<br /> 	 i = vect_diff.size();<br /> 	}// end if condition<br />     } // end for (i)loop<br /> }// end for (y) loop <br /> <br /> [/code]<br /> I hope that someone can answer me  how to find all posssible reordering set it is urgent pleasssssse<br /> <br /> <br /> <br /> <br /> <br /> <br /> ]]></description>
				<guid isPermaLink="true">http://forums.hotjoe.com/posts/preList/707/2639.page</guid>
				<link>http://forums.hotjoe.com/posts/preList/707/2639.page</link>
				<pubDate><![CDATA[Mon, 15 Mar 2010 23:59:07]]> GMT</pubDate>
				<author><![CDATA[ sara12345]]></author>
			</item>
	</channel>
</rss>
