Python Linear Programming on Ubuntu

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fett

    Python Linear Programming on Ubuntu

    I am trying to find a wrapper to do linear programming within python.
    I am using an ubuntu machine and I have apt-get'd lp_solve, which
    works just fine. If someone knows of a wrapper that will work with
    that that'd be great.

    I also heard that scipy has a wrapper, however, I can't find any
    documentation on it, nor can I seem to find it with dir(). If anyone
    knows where there is good documentation on this I would love to use
    that (the more native to python the better imo).

    I have tried many things, including http://lpsolve.sourceforge.net/5.5/Python.htm,
    openopt, and cvxopt. I can't seem to find any with enough
    documentation to get me off the ground. Some I can't compile, some I
    can't even find out how to compile.

    If anyone knows of an LP package (preferably with IP as well, like
    lp_solve has), that interfaces well with python and has enough
    documentation to get a dependency newb like myself off the ground that
    would be great.
  • Aaron \Castironpi\ Brady

    #2
    Re: Python Linear Programming on Ubuntu

    On Sep 16, 8:50 pm, Fett <FettMan...@gma il.comwrote:
    I am trying to find a wrapper to do linear programming within python.
    I am using an ubuntu machine and I have apt-get'd lp_solve, which
    works just fine. If someone knows of a wrapper that will work with
    that that'd be great.
    >
    I also heard that scipy has a wrapper, however, I can't find any
    documentation on it, nor can I seem to find it with dir(). If anyone
    knows where there is good documentation on this I would love to use
    that (the more native to python the better imo).
    >
    I have tried many things, includinghttp://lpsolve.sourcef orge.net/5.5/Python.htm,
    openopt, and cvxopt. I can't seem to find any with enough
    documentation to get me off the ground. Some I can't compile, some I
    can't even find out how to compile.
    >
    If anyone knows of an LP package (preferably with IP as well, like
    lp_solve has), that interfaces well with python and has enough
    documentation to get a dependency newb like myself off the ground that
    would be great.
    Google says:

    about 254,000 for linear programming python.

    Link 3 is:



    Scroll down.

    Comment

    • Robert Kern

      #3
      Re: Python Linear Programming on Ubuntu

      Fett wrote:
      I am trying to find a wrapper to do linear programming within python.
      I am using an ubuntu machine and I have apt-get'd lp_solve, which
      works just fine. If someone knows of a wrapper that will work with
      that that'd be great.
      >
      I also heard that scipy has a wrapper, however, I can't find any
      documentation on it, nor can I seem to find it with dir(). If anyone
      knows where there is good documentation on this I would love to use
      that (the more native to python the better imo).
      No, scipy doesn't have such a wrapper, sorry.
      I have tried many things, including http://lpsolve.sourceforge.net/5.5/Python.htm,
      openopt, and cvxopt. I can't seem to find any with enough
      documentation to get me off the ground. Some I can't compile, some I
      can't even find out how to compile.
      >
      If anyone knows of an LP package (preferably with IP as well, like
      lp_solve has), that interfaces well with python and has enough
      documentation to get a dependency newb like myself off the ground that
      would be great.
      PuLP should be fairly easy to build against GLPK or COIN (provided you have them
      installed; I'm pretty sure Ubuntu has a GLPK package but I'm not sure about
      COIN), but you will have to edit the Makefile for your system:

      Magdalene adalah media online berisi artikel dan podcast perempuan, feminisme, lifestyle, beauty, sosial, politik, berperspektif gender.


      You can ask on scipy-users about OpenOpt, and hopefully Dmitrey will be able to
      help you. If you want to get cvxopt or the Python wrappers in lp_solve itself
      working, I suggest asking their mailing lists.

      --
      Robert Kern

      "I have come to believe that the whole world is an enigma, a harmless enigma
      that is made terrible by our own mad attempt to interpret it as though it had
      an underlying truth."
      -- Umberto Eco

      Comment

      • Fett

        #4
        Re: Python Linear Programming on Ubuntu

        On Sep 16, 9:00 pm, "Aaron \"Castironpi \" Brady"
        <castiro...@gma il.comwrote:
        On Sep 16, 8:50 pm, Fett <FettMan...@gma il.comwrote:
        >
        >
        >
        I am trying to find a wrapper to do linear programming within python.
        I am using an ubuntu machine and I have apt-get'd lp_solve, which
        works just fine. If someone knows of a wrapper that will work with
        that that'd be great.
        >
        I also heard that scipy has a wrapper, however, I can't find any
        documentation on it, nor can I seem to find it with dir(). If anyone
        knows where there is good documentation on this I would love to use
        that (the more native to python the better imo).
        >
        I have tried many things, includinghttp://lpsolve.sourcef orge.net/5.5/Python.htm,
        openopt, and cvxopt. I can't seem to find any with enough
        documentation to get me off the ground. Some I can't compile, some I
        can't even find out how to compile.
        >
        If anyone knows of an LP package (preferably with IP as well, like
        lp_solve has), that interfaces well with python and has enough
        documentation to get a dependency newb like myself off the ground that
        would be great.
        >
        Google says:
        >
        about 254,000 for linear programming python.
        >
        Link 3 is:
        >

        >
        Scroll down.
        Yes, many of those seem to be deprecated, without destinations to
        links, most are poorly or not documented at all. The few that are, I
        still can't get running. Of those 254, I think I have tried at least
        10 pages worth. Still no luck.

        # lpsolvpy - Can't get it to compile - dependency problems.
        # Lp_solve5 - NO python binding yet. Volunteers needed for python
        bindings.
        # pycplex - You need to compile the CPX.so module. Change the required
        paths to CPLEX, Python and numpy in the Makefile, and type "make". Not
        sure what to do here.
        # GLPK (GNU Linear Programming Kit) - Hrm... might be something here,
        I missed the second link to the python bindings, looked all over the
        glpk site for anything about python.
        # SciPy -- http://www.scipy.org - supposedly has this, but as I said,
        I can't find any mention of it anywhere but on the site you linked.
        # pySimplex - (broken link)(broken link)
        # Simplex - link is broken, but nothing is mentioned

        I'll take a closer look at glpk's python bindings and if there is any
        documentation on them, maybe I'll have some luck. btw, I have been
        looking for something that works, I have over 5 packages on my desktop
        that I have tried to get up and running, but none of them seem to
        work. glpk makes 6.

        Comment

        • Aaron \Castironpi\ Brady

          #5
          Re: Python Linear Programming on Ubuntu

          On Sep 16, 9:25 pm, Fett <FettMan...@gma il.comwrote:
          On Sep 16, 9:00 pm, "Aaron \"Castironpi \" Brady"
          >
          >
          >
          <castiro...@gma il.comwrote:
          On Sep 16, 8:50 pm, Fett <FettMan...@gma il.comwrote:
          >
          I am trying to find a wrapper to do linear programming within python.
          I am using an ubuntu machine and I have apt-get'd lp_solve, which
          works just fine. If someone knows of a wrapper that will work with
          that that'd be great.
          >
          I also heard that scipy has a wrapper, however, I can't find any
          documentation on it, nor can I seem to find it with dir(). If anyone
          knows where there is good documentation on this I would love to use
          that (the more native to python the better imo).
          >
          I have tried many things, includinghttp://lpsolve.sourcef orge.net/5.5/Python.htm,
          openopt, and cvxopt. I can't seem to find any with enough
          documentation to get me off the ground. Some I can't compile, some I
          can't even find out how to compile.
          >
          If anyone knows of an LP package (preferably with IP as well, like
          lp_solve has), that interfaces well with python and has enough
          documentation to get a dependency newb like myself off the ground that
          would be great.
          >
          Google says:
          >
          about 254,000 for linear programming python.
          >
          Link 3 is:
          >>
          Scroll down.
          >
          Yes, many of those seem to be deprecated, without destinations to
          links, most are poorly or not documented at all. The few that are, I
          still can't get running. Of those 254, I think I have tried at least
          10 pages worth. Still no luck.
          >
          # lpsolvpy - Can't get it to compile - dependency problems.
          # Lp_solve5 - NO python binding yet. Volunteers needed for python
          bindings.
          # pycplex - You need to compile the CPX.so module. Change the required
          paths to CPLEX, Python and numpy in the Makefile, and type "make". Not
          sure what to do here.
          # GLPK (GNU Linear Programming Kit) - Hrm... might be something here,
          I missed the second link to the python bindings, looked all over the
          glpk site for anything about python.
          # SciPy --http://www.scipy.org- supposedly has this, but as I said,
          I can't find any mention of it anywhere but on the site you linked.
          # pySimplex - (broken link)(broken link)
          # Simplex - link is broken, but nothing is mentioned
          >
          I'll take a closer look at glpk's python bindings and if there is any
          documentation on them, maybe I'll have some luck. btw, I have been
          looking for something that works, I have over 5 packages on my desktop
          that I have tried to get up and running, but none of them seem to
          work. glpk makes 6.
          If you can find one working in C, use ctypes to link into Python. We
          can help you with that part. It lets you pass primitive types,
          structs, arrays, pointers, to C modules and return values. You need
          to know the C signatures to set up the Pythonized signatures.

          Comment

          • Fett

            #6
            Re: Python Linear Programming on Ubuntu

            On Sep 16, 9:44 pm, "Aaron \"Castironpi \" Brady"
            <castiro...@gma il.comwrote:
            On Sep 16, 9:25 pm, Fett <FettMan...@gma il.comwrote:
            >
            >
            >
            On Sep 16, 9:00 pm, "Aaron \"Castironpi \" Brady"
            >
            <castiro...@gma il.comwrote:
            On Sep 16, 8:50 pm, Fett <FettMan...@gma il.comwrote:
            >
            I am trying to find a wrapper to do linear programming within python.
            I am using an ubuntu machine and I have apt-get'd lp_solve, which
            works just fine. If someone knows of a wrapper that will work with
            that that'd be great.
            >
            I also heard that scipy has a wrapper, however, I can't find any
            documentation on it, nor can I seem to find it with dir(). If anyone
            knows where there is good documentation on this I would love to use
            that (the more native to python the better imo).
            >
            I have tried many things, includinghttp://lpsolve.sourcef orge.net/5.5/Python.htm,
            openopt, and cvxopt. I can't seem to find any with enough
            documentation to get me off the ground. Some I can't compile, some I
            can't even find out how to compile.
            >
            If anyone knows of an LP package (preferably with IP as well, like
            lp_solve has), that interfaces well with python and has enough
            documentation to get a dependency newb like myself off the ground that
            would be great.
            >
            Google says:
            >
            about 254,000 for linear programming python.
            >
            Link 3 is:
            >>
            Scroll down.
            >
            Yes, many of those seem to be deprecated, without destinations to
            links, most are poorly or not documented at all. The few that are, I
            still can't get running. Of those 254, I think I have tried at least
            10 pages worth. Still no luck.
            >
            # lpsolvpy - Can't get it to compile - dependency problems.
            # Lp_solve5 - NO python binding yet. Volunteers needed for python
            bindings.
            # pycplex - You need to compile the CPX.so module. Change the required
            paths to CPLEX, Python and numpy in the Makefile, and type "make". Not
            sure what to do here.
            # GLPK (GNU Linear Programming Kit) - Hrm... might be something here,
            I missed the second link to the python bindings, looked all over the
            glpk site for anything about python.
            # SciPy --http://www.scipy.org-supposedly has this, but as I said,
            I can't find any mention of it anywhere but on the site you linked.
            # pySimplex - (broken link)(broken link)
            # Simplex - link is broken, but nothing is mentioned
            >
            I'll take a closer look at glpk's python bindings and if there is any
            documentation on them, maybe I'll have some luck. btw, I have been
            looking for something that works, I have over 5 packages on my desktop
            that I have tried to get up and running, but none of them seem to
            work. glpk makes 6.
            >
            If you can find one working in C, use ctypes to link into Python. We
            can help you with that part. It lets you pass primitive types,
            structs, arrays, pointers, to C modules and return values. You need
            to know the C signatures to set up the Pythonized signatures.
            Ok, it seems that I have found one (although without an integer
            programming component): upon searching for glpk in the package manager
            in ubuntu I found a package called cvxopt, it is a bit clunky
            (compared to the niceness of lp_solve), but I think I can figure this
            one out. Thanks all who answered.

            Comment

            • Joachim Dahl

              #7
              Re: Python Linear Programming on Ubuntu

              CVXOPT supports ILP via GLPK or MOSEK. Documentation is in the doc-
              strings
              for cvxopt.glkp.ilp and cvxopt.mosek.il p.

              The ILP interfaces are not mentioned otherwise in the documentation,
              as the main
              focus of CVXOPT is convex solvers.

              For additional questions on CVXOPT please use the discussion forum:


              best regards
              Joachim

              On Sep 17, 5:57 am, Fett <FettMan...@gma il.comwrote:
              On Sep 16, 9:44 pm, "Aaron \"Castironpi \" Brady"
              >
              >
              >
              <castiro...@gma il.comwrote:
              On Sep 16, 9:25 pm, Fett <FettMan...@gma il.comwrote:
              >
              On Sep 16, 9:00 pm, "Aaron \"Castironpi \" Brady"
              >
              <castiro...@gma il.comwrote:
              On Sep 16, 8:50 pm, Fett <FettMan...@gma il.comwrote:
              >
              I am trying to find a wrapper to do linear programming within python.
              I am using an ubuntu machine and I have apt-get'd lp_solve, which
              works just fine. If someone knows of a wrapper that will work with
              that that'd be great.
              >
              I also heard that scipy has a wrapper, however, I can't find any
              documentation on it, nor can I seem to find it with dir(). If anyone
              knows where there is good documentation on this I would love to use
              that (the more native to python the better imo).
              >
              I have tried many things, includinghttp://lpsolve.sourcef orge.net/5.5/Python.htm,
              openopt, andcvxopt. I can't seem to find any with enough
              documentation to get me off the ground. Some I can't compile, some I
              can't even find out how to compile.
              >
              If anyone knows of an LP package (preferably with IP as well, like
              lp_solve has), that interfaces well with python and has enough
              documentation to get a dependency newb like myself off the groundthat
              would be great.
              >
              Google says:
              >
              about 254,000 for linear programming python.
              >
              Link 3 is:
              >>
              Scroll down.
              >
              Yes, many of those seem to be deprecated, without destinations to
              links, most are poorly or not documented at all. The few that are, I
              still can't get running. Of those 254, I think I have tried at least
              10 pages worth. Still no luck.
              >
              # lpsolvpy - Can't get it to compile - dependency problems.
              # Lp_solve5 - NO python binding yet. Volunteers needed for python
              bindings.
              # pycplex - You need to compile the CPX.so module. Change the required
              paths to CPLEX, Python and numpy in the Makefile, and type "make". Not
              sure what to do here.
              # GLPK (GNU Linear Programming Kit) - Hrm... might be something here,
              I missed the second link to the python bindings, looked all over the
              glpk site for anything about python.
              # SciPy --http://www.scipy.org-supposedlyhas this, but as I said,
              I can't find any mention of it anywhere but on the site you linked.
              # pySimplex - (broken link)(broken link)
              # Simplex - link is broken, but nothing is mentioned
              >
              I'll take a closer look at glpk's python bindings and if there is any
              documentation on them, maybe I'll have some luck. btw, I have been
              looking for something that works, I have over 5 packages on my desktop
              that I have tried to get up and running, but none of them seem to
              work. glpk makes 6.
              >
              If you can find one working in C, use ctypes to link into Python.  We
              can help you with that part.  It lets you pass primitive types,
              structs, arrays, pointers, to C modules and return values.  You need
              to know the C signatures to set up the Pythonized signatures.
              >
              Ok, it seems that I have found one (although without an integer
              programming component): upon searching for glpk in the package manager
              in ubuntu I found a package calledcvxopt, it is a bit clunky
              (compared to the niceness of lp_solve), but I think I can figure this
              one out. Thanks all who answered.

              Comment

              • Harold Fellermann

                #8
                Re: Python Linear Programming on Ubuntu

                >
                Yes, many of those seem to be deprecated, without destinations to
                links, most are poorly or not documented at all. The few that are, I
                still can't get running. Of those 254, I think I have tried at least
                10 pages worth. Still no luck.
                >
                # lpsolvpy - Can't get it to compile - dependency problems.
                # Lp_solve5 - NO python binding yet. Volunteers needed for python
                bindings.
                # pycplex - You need to compile the CPX.so module. Change the required
                paths to CPLEX, Python and numpy in the Makefile, and type "make". Not
                sure what to do here.
                # GLPK (GNU Linear Programming Kit) - Hrm... might be something here,
                I missed the second link to the python bindings, looked all over the
                glpk site for anything about python.
                # SciPy -- http://www.scipy.org - supposedly has this, but as I said,
                I can't find any mention of it anywhere but on the site you linked.
                # pySimplex - (broken link)(broken link)
                # Simplex - link is broken, but nothing is mentioned
                >
                I'll take a closer look at glpk's python bindings and if there is any
                documentation on them, maybe I'll have some luck. btw, I have been
                looking for something that works, I have over 5 packages on my desktop
                that I have tried to get up and running, but none of them seem to
                work. glpk makes 6.
                You are right that this is an unsatisfying experience. Fortunately,
                the referred site is a wiki. Why don't you edit it and delete the
                broken
                links or add the package that did the job for you to the list, so that
                others do not need to go through the same hassle.

                - harold -

                Comment

                • Martin Manns

                  #9
                  Re: Python Linear Programming on Ubuntu

                  On Tue, 16 Sep 2008 19:25:58 -0700 (PDT)
                  Fett <FettManChu@gma il.comwrote:
                  # SciPy -- http://www.scipy.org - supposedly has this, but as I said,
                  I can't find any mention of it anywhere but on the site you linked.
                  I found OpenOpt on the site:


                  I downloaded the svn version and installed it on my Debian box.
                  There were some error messages while installing. However, the example
                  seems to work anyways. I am using the solver glpk from the
                  package python-glpk.

                  I hope that this works on your Ubuntu system as well.

                  Comment

                  Working...