Global remarks and comments
Components of a linear program
How to run this software?
(Basic feature) How to add/remove a constraint?
(Basic feature) How to add an objective function?
Status area
Automatic zoom
Additional features
New features (available since the release of Version 2.0)
New new features (available since the release of Version 3.0)
A linear program is defined by a set of linear constraints and a linear objective function. Here, we are only interested in linear programs having 2 variables, x and y, which means that any constraint can be written as « ax + by op c » (op being « ≥ », « = » or « ≤ ») and that the objective function can be written as « min/max (dx + ey) » (min for « minimize » and max for « maximize »), where the values a, b, c, d and e are constant.
To summarize, solving a linear program consists in optimizing (i.e., minimizing or maximizing) a linear function over a convex set (polyhedron) which, in 2 dimensions, is a polygon (possibly empty or unbounded). In what follows, this polygon will be refered to as the feasible polygon or constraints polygon. The « edges » of the polygon are called facets. A point belonging to two adjacent facets is called a basic point, or (with a slight abuse of terminology) a feasible basic solution. Let z* be the (finite) optimal value of a linear program (i.e., the best value that any of its feasible basic solutions can have), and let its objective function be [opt] (dx + ey) (where [opt] is equal to either min or max): then, the line dx + ey = z* is called the optimal line.
If we also require that the variables x and y only take integer values, then the obtained problem is called an integer linear program.
In its current release, this software has been written as a Java program (and more precisely released as a JAR archive). As for any Java program, this means that, in order to run it, you will need to have a Java Virtual Machine (or JVM, in short) installed on your computer.
The command that needs to be executed in a console or terminal in order to run a Java program called G2DS and released as a JAR archive (which means that its full name is « G2DS.jar ») is the following one (where « java » is precisely the name of the program corresponding to the JVM, and where « > » is the symbol for the command prompt):
Adding a constraint is very easy: just fill in the 3 text fields of the 3rd line. The first one contains the coefficient of x in the constraint, the second one the coefficient of y, and the last one the right-hand side of the constraint. Do not forget to select the inequality sign you need (« ≥ » or « ≤ »). Then, press the « Add » button and the constraint will be added to the list of constraints, i.e., the combo box containing all the constraints, while the feasible polygon will be automatically updated. There is another way to add a constraint, but we shall describe it in the section Additional features. (Actually, there even exists a third alternative way of adding constraints, which is described in the section New new features (available since the release of Version 3.0).) If you press the « Cancel » button, you clear all the text fields of the 3rd line.
Some additional remarks:
Adding an objective function is almost the same as adding a new constraint. The 2 text fields of the 1st line respectively contain the coefficient of x and the coefficient of y in the objective function (and the 3 remarks of the previous section concerning the input procedure also apply in this case). Then, select « min » (for minimization), « max » (for maximization) or « none » (for adding no objective function), and press the « Set » button. The linear program will be solved automatically. Note that, each time you define a new objective function (by pressing « Set »), the former one is lost.
Status areaThe status area is located between the three upper lines of the software and the area where the graphical representation of the problem is displayed. This status area, displayed in red, is used by the software to inform you of the current status of the linear program (number of feasible basic solutions, optimal value, information about integer solutions, etc.). Each time you launch the software, you can of course add as many constraints as you like (the only limit being the processing time!) and redefine the objective function as many times as you want. Each time a constraint is added or removed, the status area and the constraints polygon are automatically updated (the facets of the latter are the black lines). In the same way, when the objective function is defined/redefined, the optimal line is displayed on screen and the status is updated, except when the linear program has no optimal solution (in such a case, the information will be displayed in the status area anyway).
Automatic zoomIn order to draw the feasible polygon correctly, the software automatically computes the most suitable zoom factor. You can be informed of the scaling factor used by the software through the 2 values « Xmax » and « Ymax ». There are 10 points on both the x axis and the y axis, the distance between two consecutive points being constant. The 10th point on the x axis corresponds to the point with x = Xmax and the 10th on the y axis to the one with y = Ymax. The respective x coordinates of the other points on the x axis are then Xmax/10, 2*Xmax/10, etc.
Additional featuresThis section details the additional features provided by this software which are not absolutely necessary for a basic use. To begin with, we describe the features associated with buttons:
This section details the new features available in this software since the release of Version 2.0. They provide the possibility of solving the linear program defined by the user as an integer linear program. More precisely, it will be solved as a linear program first, and then as an integer linear program. To enter this mode, you just have to click (with a simple click) on the underlined text area « Such that: » (which, as soon as you place the mouse cursor on it, actually displays the number of constraints, also underlined): then, the suffix « (i) » is added to this text area (to point out the fact that we have entered a mode where the integer solutions are displayed), and the information about the integer solutions of the linear program (number of integer solutions, unbounded feasible polygon, existence of an optimal integer solution, etc.) are now displayed in the status area. Moreover, the integer solutions contained in the display area are displayed as little black squares, and, if an objective function has been defined and if the optimal integer value is bounded (and provided that the optimal integer solution is contained in the display area!), this optimal integer solution is displayed as a little square with color (4).
In order to exit this mode (and to come back to the normal one), you just have to click once again (with a simple click) on the underlined text area « Such that: ». It should be noticed that the reason why the display area is defined with respect to the feasible basic solutions, and not with respect to the integer solutions (and, in particular, not with respect to the optimal integer solution), is that the optimal integer solution can be quite far from all the feasible basic solutions (and, so, from the optimal basic solution also). For instance, if we consider the following linear program: « maximize -3x+y, such that y ≥ 3/2, -x+20y ≤ 30, x ≥ 0 and y ≥ 0 », then the optimal basic solution is (x = 0, y = 3/2), while the optimal integer solution is (x = 10, y = 2)!
This section details the new (new) features available in this software since the release of Version 3.0.
Firstly, if you click (with a simple click) on the underlined text area « Problem status: » (which, as soon as you place the mouse cursor on it, actually displays the number of facets, also underlined), then a first facet of the problem (among the ones that are neither « x = 0 » nor « y = 0 », if at least one such facet exists!) is selected (and thus will be of color (3)), and the corresponding constraint is also selected in the list of constraints (2nd line). If you click again (with a simple click) on this text area, another facet is selected instead (as well as the corresponding constraint), and then another one, and so on. If you click a sufficient number of times so that all the facets have been successively selected, then the process will start again from the first facet selected. Notice that adding or removing a constraint (and other events, such as asking the software to solve the linear program as an integer linear program) will make the software exit this mode (and then you will have to start the whole process again from the beginning, if needed).
Secondly, if you click (with a simple click) on the underlined text area that indicates the number of feasible basic solutions of the problem (1st line of the status area, in red), then a first feasible basic solution of the problem is selected (and thus will be of color (3)), and its coordinates are displayed in the text area « Basic solution displayed: » (in which, as long as this is not the case, is simply displayed « Basic solution displayed: none »). If you click again (with a simple click) on this text area, another feasible basic solution is selected instead (and, again, its coordinates are displayed in the text area « Basic solution displayed: »), and then another one, and so on. If you click a sufficient number of times so that all the feasible basic solutions have been successively selected, then the process will start again from the first feasible basic solution. Notice, here again, that adding or removing a constraint (and other events, such as asking the software to solve the linear program as an integer linear program) will make the software exit this mode (and then you will have to start the whole process again from the beginning, if needed).
Thirdly, if you click (with a simple click) on the underlined text area that is located on the bottom right, and that normally indicates the language (« FR » for French and « GB » for English) as well as the version number (but that actually displays, as soon as you place the mouse cursor on it, the copyright and the language), then the language used for displaying the information in the software will be modified: it will become French if it was previously English, and English if it was French.
Finally, Version 3.0 of this software allows you to add constraints and/or an objective function to the linear program to be solved, using a text file (rather than typing them by hand one by one). In order to do so, you just have to write, in the text field located on the left of the « Load file » button, the name of the text file to be used, and then to press this « Load file » button. The objective function will then be updated if needed (as well as the screen display), and the constraints contained in this file will be added to the linear program to be solved (which will then automatically be solved once again), and will also appear in the list of constraints (2nd line). The format of such a file must be as follows: