Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Using nodecnt or nodeint with the python API

    Posted 08/25/15 05:34 PM

    Originally posted by: airgt


    I am trying to get the number of nodes in a b&b tree using the python API.

    I know the command is nodecnt/nodeint and have tried different combinations of:

    my_prob.solution.nodecnt()

    but none seem to work. Does anyone know the correct syntax?


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Using nodecnt or nodeint with the python API

    Posted 08/26/15 04:43 AM

    How do you know the function is nodecnt/nodeint? It actually is Cplex.solution.progress.get_num_nodes_processed():

    #!/usr/bin/python
    
    import sys
    import cplex
    
    for arg in sys.argv[1:]:
        cpx = cplex.Cplex()
        cpx.read(arg)
        cpx.solve()
        print cpx.solution.progress.get_num_nodes_processed()
    

     


    #CPLEXOptimizers
    #DecisionOptimization