[CHiPPS] Questions on ALPS interface

Hans Pirnay hans.pirnay at rwth-aachen.de
Tue Sep 14 12:57:05 EDT 2010


Dear Yan,

thank you for your help!

another problem has come up: In the function TreeNode::process I set
the status of the node and also the quality_ variable. Do I understand
correctly, that quality_ is supposed to store the relaxed value of a
node? (That is what I gathered from the Knap example). While running
the code, I encountered the following issue. The code returns the
lines

...
Alps0240I Processed 30100 nodes, has 4620 nodes, best relaxed 3085.17,
best feasible 3089
Alps0240I Processed 30200 nodes, has 4568 nodes, best relaxed 3088.27,
best feasible 3089
Alps0240I Processed 30300 nodes, has 4545 nodes, best relaxed 3088.53,
best feasible 3089
Alps0240I Processed 30400 nodes, has 4487 nodes, best relaxed 3089.44,
best feasible 3089
Alps0240I Processed 30500 nodes, has 4437 nodes, best relaxed 3093.44,
best feasible 3089
Alps0240I Processed 30600 nodes, has 4386 nodes, best relaxed 3095.07,
best feasible 3089
Alps0240I Processed 30700 nodes, has 4337 nodes, best relaxed 3097.29,
best feasible 3089
...
Alps0208I Found an optimal solution. 39373 nodes processed, 0 nodes left
Alps0260I Quality of the best solution found: 3089 ; depth 22
Alps0267I Number of nodes processed: 39373
Alps0268I Number of nodes branched: 19686
Alps0269I Number of nodes pruned before processing: 0
Alps0270I Number of nodes left: 0
Alps0272I Tree depth: 24

which obviously means that the algorithm didn't cut off the nodes that
had relaxed objective values higher than the best feasible solution.
Do I have to set an option so that these nodes are pruned before
processing? Do I have to do it myself?

Besides this problem: What is the value of solEstimate_ in
AlpsTreeNode used for?

Thanks again for your support

Hans

On Tue, Sep 14, 2010 at 4:11 PM, Yan Xu <Yan.Xu at sas.com> wrote:
> Very sorry for the late response.
>
> 1. For serial code, they are the same. getIncumbentValue() is used by a process to query the quality of the best solution it stores. getBestQuality() is only used by the master process to query the quality of the best solution it knows.  For parallel code, see following code snippet from AlpsKnowledgeBrokerMPI.h
>
>    /** @name Report search results. */
>    //@{
>    /** The process queries the quality of the incumbent this process stores. */
>    virtual double getIncumbentValue() const {
>        double bestObj = ALPS_OBJ_MAX;
>        if (AlpsKnowledgeBroker::hasKnowledge(AlpsKnowledgeTypeSolution)) {
>            bestObj = getBestKnowledge(AlpsKnowledgeTypeSolution).second;
>            if (incumbentValue_ > bestObj) {
>                return bestObj;
>            }
>        }
>        return incumbentValue_;
>    }
>
>    /** The master queries the quality of the best solution it knowns. */
>    virtual double getBestQuality() const {
>       if (globalRank_ == masterRank_) {
>            if (getNumKnowledges(AlpsKnowledgeTypeSolution) > 0) {
>                return getBestKnowledge(AlpsKnowledgeTypeSolution).second;
>            }
>            else {
>                return ALPS_OBJ_MAX;
>            }
>        }
>        else {
>            return ALPS_OBJ_MAX;
>        }
>    }
>
>
> 2. The return code of AlpsTreeNode::process is not actually used. So, you can simply return  0. I will update the comment.
>
> Hope this helps & thanks for trying CHiPPS,
>
> Yan
>
>
> -----Original Message-----
> From: chipps-bounces at list.coin-or.org [mailto:chipps-bounces at list.coin-or.org] On Behalf Of Hans Pirnay
> Sent: Wednesday, September 08, 2010 11:31 AM
> To: chipps at list.coin-or.org
> Subject: [CHiPPS] Questions on ALPS interface
>
> Hello everyone,
>
> first of all, thanks for the great piece of code!
>
> While using the ALPS interface I have come across two questions:
>
> 1. what is the difference between KnowledgeBroker::getIncumbentValue()
> and KnowledgeBroker::getBestQuality() ?
>
> 2. what is the integer output of the function AlpsTreeNode::process that I am supposed to overload supposed to be? In the Knap example, this returns "false" (e.g. 0) if no solution was found and 1 otherwise. Is that how it's supposed to be done?
>
> Thanks
>
> Hans
>
> _______________________________________________
> CHiPPS mailing list
> CHiPPS at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/chipps
>
>




More information about the CHiPPS mailing list