Current location - Plastic Surgery and Aesthetics Network - Wedding supplies - [Mathematical Modeling Algorithm] (Part IV) Lingo, an artifact to solve planning problems (Part II)
[Mathematical Modeling Algorithm] (Part IV) Lingo, an artifact to solve planning problems (Part II)
Planning problem is originally a process of giving optimization conditions and constraints, and then obtaining independent variables that meet the conditions. Then it can naturally solve nonlinear equation problems, so it can be solved by giving an initial point that can improve the operation speed and then giving constraints.

Output result

The following is the task flow chart.

Write a argot program:

TSP can be expressed as an integer programming model in many ways. One method of modeling introduced here is to treat every solution (not necessarily the best) of the problem as a "tour".

Introduce 0- 1 integer variable.

The goal is to minimize

Two obvious conditions must be met:

1. After visiting the city, you must have an exact city to go to;

Before visiting a city, you must have an exact city that you have just visited.

Use the following two sets of constraints to realize the above two conditions respectively.

Here we get a model, which is an integer programming model of assignment problem. But the above two conditions for

TSP is not a sufficient condition, but a necessary condition.

For example, in the following cases, it is obviously not a solution to the TSP problem.

Iron and steel industry is one of the foundations of national industry, and iron ore is the main raw material base of iron and steel industry. Many modern iron mines are mined in the open pit, and their production is mainly accomplished by loading electric shovels (hereinafter referred to as shovels) and transporting electric wheel dump trucks (hereinafter referred to as trucks). Improving the utilization rate of these large equipment is the primary task to improve the economic benefits of open pit mines.

There are several rock piles produced by blasting in open-pit mines, each of which is called a shovel position, and each shovel position divides the stones into ores and rocks in advance according to the iron content. Generally speaking, the average iron content is not less than 25%, otherwise it is rock. The amount of ore and rock at each shovel position and the average iron content of ore (called grade) are known. At most one shovel can be placed in each shovel position, and the average loading time of the shovel is 5 minutes.

The dump site (hereinafter referred to as the dump site) includes leakage for ore unloading, two railway inversion sites (hereinafter referred to as the inversion site), leakage rock for rock unloading and rock yard. Each unloading location has its own production requirements. From the point of view of protecting national resources and considering the economic benefits of the mine, the ore blending should be carried out according to the iron content required by the unloading point (assuming that the requirement is 29.5% 1%, which is called grade limit), and the ore blending amount can reach the grade limit within one shift (8 hours). In the long run, the unloading point can be moved, but it will not change within one shift. The average unloading time of trucks is 3 minutes.

The load capacity of trucks used is 154 tons, with an average speed of 28 km/h. The trucks consume a lot of oil, and each truck consumes nearly 1 ton of diesel per shift. The engine needs to consume a lot of battery energy when it is ignited, so it is only ignited once at the beginning of a shift. The energy consumed by trucks while waiting is also considerable. In principle, trucks should not wait when arranging. Neither the scraper nor the unloading point can serve two or more trucks at the same time. Trucks are always full.

The road from each shovel position to each unloading point is a dedicated two-way lane with a width of 60 m, and there will be no traffic jam. The mileage of each road is known.

The production plan of a shift shall include the following contents: (1) How many electric shovels will be dispatched and in which shovel positions; Dispatch several trucks, on which routes and how many times (due to random factors, the loading and unloading time and transportation time are inaccurate, so the scheduling scheme is invalid, as long as the number and arrangement of trucks on each route are clear). A qualified plan should meet the requirements of output and quality (grade) without waiting for trucks, and a good plan should also test one of the following two principles:

An open pit mine has 10 shovel position, 5 unloading points, 7 forklifts and 20 trucks. The output requirements of one shift at each unloading point are: ore leakage1.2000 tons, inverted station I1.3000 tons, inverted station II1.3000 tons, rock leakage1.9000 tons, and rock yard1.3000 tons.

The two-dimensional schematic diagram of shovel position and unloading point position is shown in the following figure, and the distance (km) from each shovel position to the unloading point is shown in the following table, as well as the amount of ore and rock (ten thousand tons) and the average iron content of ore at each shovel position.

This example takes Principle 1 as an example to show the complete modeling and solving process.

Various symbols and units are described as follows:

:No. of stone transportation volume at shovel position to unloading point, unit: train number (one of the requirements in the final scheme, the total number of trains in the corresponding lane).

: Distance from shovel position to unloading point number, unit: km.

: Time required to start a cycle from shovel position to unloading point number, unit: minutes.

: From the shovel position number to the maximum number of trucks that can run at the same time to the unloading point number, unit: one of the requirements of the final plan, the number of trucks that can run at the same time arranged in the corresponding lane.

: The maximum number of times a car can run from shovel position No to unloading point number in one shift, unit: times.

: 1 shovel's iron ore output times 100.

, unit: vehicle times;

: Shovel iron ore reserve, unit: 10,000 tons.

: Rock reserves at the shovel position, in ten thousand tons.

: Describe whether the shovel position 1 uses the variable 0- 1.

=

Analyze all objective functions and constraints:

Objective function:

Restrictions:

You can then build the following model:

The process is as follows: