[Ncr-Python.in] [HELP] QUERIES RELATED TO PYTHON

Raakesh kumar kumar3180 at gmail.com
Mon Apr 22 14:05:38 CEST 2013


On Sun, Apr 21, 2013 at 4:54 PM, saurabh chandra <
fatboyslimchandra at gmail.com> wrote:

> I am trying to develop an algorithm for a combinatorial optimization. The
> problem consists of a graph network with nodes and connected arcs. In this
> algorithm I have to choose an optimal combination of nodes out of all the
> nodes in the graph. The successive nodes are selected as entries in the
> list using a random search technique. Successive nodes share a precedence
> relationship.
>
[...]

> In each iteration of the algorithm I generate a combination of a subset of
> nodes chosen randomly from the whole node-set, as a list. In the same loop
> I carry out a modification of the generated list and calculate the
> objective value associated with this . A particular generated list in any
> loop will give rise to a single modified list.
>
 [/...]
Why random? What kind of modifications you are actually doing? Is it like
sorting them based open their objective values or something like that? Is
it a sort of tree/graph traversal algorithm based upon some criteria?
[...]

>
> Now I do not want same list to be generated again and again, so I maintain
> a super-list of generated lists and check the membership of each new list
> in this super-list. I restart the loop if same list appears again in the
> algorithm. As I already said the original list gets modified within an
> iteration. The problem is that although I append the super-list with the
> original list before modification, as soon as I modify this original list
> the list added to the super-list also changes automatically. Thus the
> iteration goes on even if the same list is generated again and again.
>
[/...]
I am thinking rather than maintaining a super-list(i couldn't understand
what is this) why didn't you loop through the entire list of nodes to
remove the ambiguity? And if you are modifying the first node also then
probably you would require to maintain a separate list containing the first
nodes of all the lists.

I don't know whether i would be able to help but after looking at the
scenario i think your code with some description should help me understand
my questions and possible solutions.
Thanks
-- 
Regards
RAKESH KUMAR
http://raakeshkumar.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ncr-python.in/attachments/20130422/8e889666/attachment.html>


More information about the Ncr-Python.in mailing list