85
IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ROUTING PROBLEM) TUTORIAL MANUAL (WORK DOCUMENT, IT IS UNDER CONSTRUCTION (8 SECTIONS OF 13, THIS MANUAL WILL BE ACTUALIZED IN A FEW DAYS) THIS DOCUMENT CONTAINS CONFIDENTIAL INFORMATION AND INTELLECTUAL PROPERTY OF DO ANALYTICS LLC. AND IS PROVIDED WITH THE UNDERSTANDING THAT ONLY WILL BE USED IN THE ASSESSMENT AND USE OF OPTEX MATHEMATICAL MODELING SYSTEM, AND WILL REMAIN CONFIDENTIAL, PROTECTING IT AGAINST INSPECTION OF THIRD PARTIES NOT EXPRESSLY AUTHORIZED BY DO ANALYTICS January 2016

IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

IMPLEMENTATION OF THE VRP PROBLEM

(VEHICLE ROUTING PROBLEM)

TUTORIAL MANUAL (WORK DOCUMENT, IT IS UNDER CONSTRUCTION

(8 SECTIONS OF 13, THIS MANUAL WILL BE ACTUALIZED IN A FEW DAYS)

THIS DOCUMENT CONTAINS CONFIDENTIAL INFORMATION AND INTELLECTUAL PROPERTY OF DO ANALYTICS LLC. AND IS PROVIDED WITH THE UNDERSTANDING THAT ONLY WILL BE USED IN THE ASSESSMENT AND USE OF OPTEX MATHEMATICAL MODELING SYSTEM, AND WILL REMAIN CONFIDENTIAL, PROTECTING IT AGAINST INSPECTION OF THIRD PARTIES NOT EXPRESSLY AUTHORIZED BY DO ANALYTICS

January 2016

Page 2: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

1

CONFIDENTIALITY AGREEMENT

TO READ THIS DOCUMENT THE READER ACKNOWLEDGES THAT IT CONTAINS CONFIDENTIAL INFORMATION INTELLECTUAL PROPERTY OF DO ANALYTICS LLC AND AGREE THAT REMAIN CONFIDENTIAL, KEEPING PEOPLE AGAINST THIRD PARTIES INSPECTION AND ORGANIZATIONS NO EXPRESSLY AUTHORIZED BY DO ANALYTICS.

THE READER ACKNOWLEDGES THAT THE METHODOLOGY OF DEVELOP MATHEMATICAL PROGRAMMING MODELS BASED ON THE CONFIGURATION OF AN INFORMATION SYSTEM AND FURTHER PROCESSING IS OWN AND ORIGINAL OF THE PRODUCT OPTEX MATHEMATICAL MODELING SYSTEM (OPTEX) , THAT IT WAS ORIGINALLY DEVELOPED BY DECISIONWARE LTDA.

AND CURRENTLY OWNS DO ANALYTICS LLC (DOA).

THE READER ACKNOWLEDGES THAT HE KNOWS THAT READ AND/OR STUDY (OR PROVIDE SOMEONE TO READ OR TO STUDY) THIS DOCUMENT WITH INTENT TO COPY / CHANGE / IMPROVE / SIMPLIFY / DISINTEGRATION / INTEGRATE / SPY (OR ANY OTHER SIMILAR ACTIVITY) i) THE METHODOLOGY IMPLIED IN OPTEX ii) INFORMATION SYSTEMS OF OPTEX, iii) COMPUTER PROGRAMS GENERATED BY OPTEX, AND / OR iv) ACCESS INTERFACES ASSOCIATED TO THE PROGRAMS THAT INTEGRATE OPTEX CORRESPOND TO A VIOLATION OF COPYRIGHT AND INTELLECTUAL PROPERTY OF DO ANALYTICS AND UNDERSTAND THAT DOA MAY TAKE LEGAL ACTIONS TO PROTECT THEIR RIGHTS.

THE INFORMATION CONTAINED IN THIS DOCUMENT MAY NOT BE DISCLOSED TO THIRD PARTIES AND SHALL NOT BE DIGITALLY COPIED OR PHOTOCOPIED, OR USED OR DISCLOSED IN WHOLE OR IN PART, FOR ANY OTHER PURPOSE THAN INTERNAL USE.

THIS RESTRICTION DOES NOT LIMIT THE RIGHT OF READER TO USE THE INFORMATION IN THIS REPORT, THAT IS PUBLIC DOMAIN OR IS OBTAINED FROM OTHER SOURCES WITHOUT RESTRICTION.

ALL INFORMATION OF THE THIRD THAT DO ANALYTICS HAS ACCESS AS A RESULT OF THIS DIFFUSION PROCESS OF THE SERVICES AND PRODUCTS THAT DO ANALYTICS OFFERES WILL BE KEPT STRICTLY CONFIDENTIAL BY DO ANALYTICS AND PROFESSIONALS OF DO ANALYTICS LINKED TO PROCESS.

ALGEBRAIC FORMULATION PRESENTED IN THIS DOCUMENT, THE SOFTWARE THAT CONTAINS THE IMPLEMENTATION OF THE MATHEMATICAL MODELS IN OPTEX CAN ONLY BE USED WITH ACADEMIC PURPOSES, AND LEARNING OF OPTEX; IF YOU WANT TO USE THE ALGEBRAIC FORMULATION AND / OR COMPUTER PROGRAMS WITH COMMERCIAL PURPOSES YOU SHOULD

ACQUIRE A FORMAL SOFTWARE LICENSE. TO USE THIS MATERIAL AS PART OF A FREE PROCESS YOU SHOULD HAVE A WRITTEN AND SIGNED AUTHORIZATION BY DO ANALYTICS.

DO ANALYTICS KEEPS THE PROPERTY OF THIS DOCUMENT AND MAY REQUEST ITS RETURN AND/OR ITS DESTRUCTION AT ANY TIME.

Page 3: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

2

IMPLEMENTATION OF THE VRP MODEL (VEHICLE ROUTING PROBLEM)

1. INTRODUCTION

1.1. OBJECTIVE

The purpose of this tutorial oriented to show to the reader, from scratch, step by step, the implementation of an optimization problem using OPTEX. This implementation is performed in two

steps:

1. Implementation of the model in OPTEX-EXCEL-MMS. Implement, in an empty template of OPTEX-EXCEL-MMS, the mathematical model

Solve the problem associated with the mathematical model using OPTEX-WEB

Solve the problem associated with the mathematical model using OPTEX-EXCEL-MMS

2. Implementation of the model in OPTEX-MMIS Import the mathematical model from the template in EXCEL to OPTEX

Check the mathematical model using the services offered by OPTEX-GUI

Generate computer programs in C, GAMS and OPL-IBM technologies. Load data from the VRP problem in an EXCEL template generated by OPTEX-GUI.

Solve the problem associated with the mathematical model using OPTEX-EXE.

To perform the first process, the interested requires to have installed in his computer the components

of OPTEX-EXCEL-MMS; for the second process is required to have installed OPTEX-MMIS.

This tutorial is not intended to teach to formulate mathematical models of optimization and therefore not analyzed or discussed the validity of the formulation; the aim is that the user understands the

steps to follow to implement a "simple" mathematical model in OPTEX-EXCEL-MMS and OPTEX-MMIS.

This tutorial document is divided into 13 sections/numerals and the presentation of the tutorial is considered it can be arranged in 8 sessions covering all the numerals, each session is linked to a

presentation of "slides" (in English) in which the material is presented, and this presentation is associated with a video (this material will be released when it is available). The organization is

presented below:

1. SESSION 1: Introduction

o Introduction to OPTEX (Section 1) o OPTEX-EXCEL-MMS Template (Section 2)

2. SESSION 2: VRP Modeling in Excel o VRP: Vehicle Routing Problem (Section 3)

o Implementing VRP Model using EXCEL (Section 4)

3. SESSION 3: Using EXCEL TO Load Data o Industrial Data Information Systems –IDIS- (Section 5)

4. SESSION 4: OPTEX-GUI – Loading Models o Loading the Model in OPTEX-MMIS (Section 6)

o Verification of the Model in OPTEX-MMIS (Section 7)

5. SESSION 5: Loading and Checking Industrial Data o Implementation and Validation of IDIS- (Section 8)

Page 4: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

3

6. SESSION 6: Solving Mathematical Models o Scenarios and Families of Scenarios (Section 9)

o Solution of Mathematical Problems (Section 10)

o Results Information System (Section 11) 7. SESSION 7: SQL Servers

o Using SQL Servers for IDIS (Section 12) 8. SESSION 8: Optimization Technologies

o Solving Problems using C (Section 13.1) o Solving Problems using GAMS (Section 13.2)

o Solving Problems using IBM OPL (Section 13.3)

SUGGESTION:

If the reader is not familiar with OPTEX we suggest that access the following URLs that point to a general presentation and a descriptive of OPTEX.

http://www.doanalytics.net/Documents/OPTEX-Presentation.pdf

http://www.doanalytics.net/Documents/OPTEX-Mathematical-Modeling-System-Descriptive.pdf

1.2. TECHNICAL SUPPORT DOCUMENTS

The official documents that support users of OPTEX are divided into documents: manual type (.docx) and slide show type (.pptx), all printed in PDF format.

These documents are available from two sources: Packaged file that is downloaded during the process of installation of OPTEX,

Documents stored individually on the web server www.doanalytics.net The latter always correspond to the latest version of OPTEX and the document. The files for

download are presented in the following tables, each file is associated with a hyperlink that allows

you to download the latest version (in Spanish) of the document from the web site www.doanalytics.net.

FILES TO DOWNLOAD

OPTEX-MMS: Instalación inicial

OPTEX-EXE: Actualización de los ejecutables

OPTEX-VRP: Actualización del tutorial VRPDSS

SUPPORT MANUALS (SPANISH)

OPTEX Descriptivo General

OPTEX Instalación

OPTEX GUI-Usuario

OPTEX GUI-Administrador

OPTEX Usuario

OPTEX Administrador

OPTEX Administrador Validación de Datos

OPTEX Conectividad en Red

OPTEX Conectividad Tecnologías de Optimización

OPTEX Documentos RTF

OPTEX EXCEL-GUI Usuario

OPTEX EXCEL-MMS Usuario

OPTEX Lenguaje Algebraico

OPTEX Modelamiento del Sistema de Información IDIS

OPTEX Modelo de Datos MMIS

OPTEX Server Administrador

OPTEX Tutorial Implementación Modelo VRP

Page 5: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

4

SUPPORT MANUALS (SPANISH)

OPTEX Tutorial Implementación Sistema de Soporte de Decisiones VRP

SUPPORT MANUALS (ENGLISH)

OPTEX Descriptivo General

OPTEX Instalación

OPTEX GUI-Usuario

OPTEX GUI-Administrador

OPTEX Usuario

OPTEX Administrador

OPTEX Administrador Validación de Datos

OPTEX Conectividad en Red

OPTEX Conectividad Tecnologías de Optimización

OPTEX Documentos RTF

OPTEX EXCEL-GUI Usuario

OPTEX EXCEL-MMS Usuario

OPTEX Lenguaje Algebraico

OPTEX Modelamiento del Sistema de Información IDIS

OPTEX Modelo de Datos MMIS

OPTEX Server Administrador

OPTEX Tutorial Implementación Modelo VRP

OPTEX Tutorial Implementación Sistema de Soporte de Decisiones VRP

TUTORIAL PRESENTATIONS

SESSION 1: Introduction

SESSION 2: VRP Modeling in EXCEL

SESSION 3: Using EXCEL to Load Data

SESSION 4: OPTEX-GUI – Loading Models

SESSION 5: Loading and Checking Industrial Data

SESSION 6: Solving Mathematical Models

SESSION 7: SQL Servers

SESSION 8: Optimization Technologies

TECHNICAL PRESENTATIONS

Presentación General OPTEX It chains with all thematic presentations.

1.3. MATHEMATICAL MODELS INFORMATION SYSTEM (MMIS)

An information system allows you to manage the data of a set of entities (objects). An information

system of a mathematical model required to define the entities that are part of the algebraic formulation of mathematical problems, these entities are associated with indexes (or sub-indices)

which identifies the objects included in the mathematical model. In what follows, is put between brackets () the index linked to the entity/object that is described, for which its attributes are stored

in the information system.

OPTEX assumes that the structure of the information system (data model) follows the principles of

relational information systems (database) which are supported in the so-called relational algebra.

SUGGESTION:

Page 6: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

5

If the reader is not familiar with relational databases, we suggest that read about technical literature and OPTEX technical manuals related to the topic, since these information guidelines will help you

to manage information systems which access the computer programs to solve mathematical

problems: http://www.doanalytics.net/Documents/Modelo_Relacional.pdf

http://www.doanalytics.net/Documents/Manual-OPTEX-Modelamiento-Sistema-Informacion-IDIS.pdf

http://www.doanalytics.net/Documents/Manual-OPTEX-Administrador-Validacion-Datos.pdf

1.4. MANAGEMENT OF DBASE (DBF) FILES

OPTEX MMS always uses tables in DBF format. This is because that the areas of control of OPTEX (MMIS) tables are always handled in DBF. In the case of the areas of application data (IDIS), they

can be handled DBF tables or servers type SQL acceded using ODBCs.

It is required to take into account two important aspects in the management of the DBF tables:

DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a

special table to store the MEMOs called XXXXX.DBT, where XXXXX is the name of the table containing fields MEMOs. It is important that these two tables (the DBF and the DBT) must be

handled jointly; when the DBT table is lost, for any reason, it is possible to lose data stored in

DBF table.

NTX Index Files: to control the order of access of records in a table, and to facilitate relationships between tables that are linked through common fields, OPTEX MMS uses the NTX

index files. There may be multiple files NTX, one for each order (index) that you want to have,

for a DBF table. The following image presents the case of the table CONJUNTO.DBF, you have MEMOs stored in the file CONJUNTO.DBT and whose ordering is set from two points of view:

CONJUNTO.NTX and CONJUNT1.NTX.

It is of special importance, since in the absence of the concept of server in the management of

the DBF tables, it is the application that opens the table the responsible for correctly handle of NTX files, avoiding the corruption/damage them. Therefore, the user must have in its mind that

if DBF tables are open for applications different from OPTEX MMS, NTX files can become corrupt losing control of the application. In this case you must delete all NTX files that are

considered are corrupt so OPTEX MMS proceed to regenerate them. In general, it is

recommended that if you find an abnormal behavior in DBF tables, mainly records that are not

Page 7: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

6

seen or deleted rows continue seeing, proceed to "delete" the NTX and check if it goes away the problem, in the event that it does not disappear again to report the problem.

For the reader interested in learning more about the DBase, it is suggested to access the information in Wikipedia (https://es.wikipedia.org/wiki/DBase).

1.5. DATA ORGANIZATION

This paragraph is important for users to directly use OPTEX installed on their computer.

Prior to the loading of the MMIS and, should be into account the way in which information for the integrated management of all mathematical modeling system should be organized. Under the

conception of OPTEX, an information system is composed of multiple databases (group of tables) that are conceived as an information areas and are classified into:

Control of Information Systems: stores the tables corresponding to a data model of a

information system. It is implemented in DBASE tables and it is part of the MMIS. Control of Mathematical Models: stores the tables corresponding to the formulation of

optimization mathematical models. It is implemented in DBASE tables and it is part of the MMIS

Business/Industrial Data: stores the tables corresponding to the data to which the user of the application has access. This area comprises two areas of data: the permanent data of the

application, and the data of scenarios of the mathematical models. The user chooses the type

of database that wants to handle, may be in DBASE tables or tables in a server type SQL. It corresponds to the so-called IDIS

OPTEX, considers the following areas or data directories:

OPTEX-GUI Control Area: stores the tables of OPTEX-GUI control. It is designed and controlled by DOA;

OPTEX-MMIS Control Area: stores the MMIS control tables. It is designed and controlled

by DOA;

IDIS Control Area: stores the IDIS control tables. This area controls all the areas in which

subdivides the IDIS. It is configured by the OPTEX-GUI administrator;

Mathematical Models (MMIS) Data Area: stores data that define mathematical optimization models. It must be configured by the administrator/modeler of OPTEX-MMIS;

IDIS Data Area: stores permanent IDIS data, it must be maintained by the IDIS users and is controlled by IDIS Control Area;

Scenarios Family Data Area: stores data that are common to a family of scenarios, it must

be maintained by the IDIS users and is controlled by the IDIS Control Area. Data from the

family of scenarios is located from the area (root) scenarios (which is defined in the table of parameterization of applications as described in the Manual OPTEX-GUI Administrator).

An area corresponds to each scenario family.

Scenarios Data Area: stores data specific to a scenario, it must be maintained by IDIS users, receives data from the solution of models, and is controlled by the IDIS Control Area. In this

area OPTEX stored data related to the algebraic and matrix/vectors structures of mathematical

Page 8: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

7

models and several reports. Scenarios data area is located under the directory associated with the family of scenarios. Each scenario has an area.

Data from the scenario family is located from the area (root) of scenarios that is defined in the data table in the Manual of the OPTEX-GUI Administrator application definition. An area

corresponds to each scenario family.

Existen algunas tablas que son comunes a todas las aplicaciones y por lo tanto se almacenan en un directorio independiente de las aplicaciones, en OPTEX este directorio corresponde al directorio

“/BIN/”.

There are some tables that are common to all applications and therefore are stored in an application-

independent directory, this directory corresponds to the directory "/ BIN /".

The tables can be in different formats. The control tables are handled in DBASE format, since they

are OPTEX control tables. The SIDI tables can be stored in DBASE or in any type of SQL Server (DB2, ORACLE, MySQL, SQL SERVER,...) which can be accessed through ODBCs (Open

DataBase Connectivity).

Normally, the DBASE control tables are organized in different directories (it is convenient, not necessary), the tables in SQL are assumed to be organized in a same TABLESPACE linked to the

application through an ODBC which will be used by OPTEX to manage the existing tables.

The following table shows an example of data areas from an OPTEX application.

AREAS OF INFORMATION SYSTEM

AREA DBF TABLES - DIRECTORY SQL TABLES -PREFIX

Control OPTEX-GUI C:/OPTEX/OPTEX (0)

Control OPTEX-MMIS C:/OPTEX/OPTEX (0)

Control IDIS DATA MODEL C:/OPTEX/aaa/aaaCO (1) (0)

Control Mathematical Modeling Information System (MMIS)

C:/OPTEX/aaa/aaaOP (1) (0)

IDIS C:/OPTEX/aaa/aaaDA (1) (2)

ROOT OF THE FAMILY OF SCENARIOS C:/OPTEX/aaa/aaaES/fff (1) fff_(1)

ESCENARIOS DE LA FAMILIA C:/OPTEX/aaa/aaaES/fff/eee (1) fff_eee_(1)

Nota: (0) DBF tables (1) aaa is associated with the application, fff with the family of scenarios and eee with the scenario (2) SQL tables without prefix

The following image shows the directories associated with the data areas of the OPTEX application. Clarifies that directories can be arranged in any way, the choice in this case is to place them all in

the same directory where the directory name is a mnemonic that acts as a prefix in all directories.

Page 9: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

8

1.6. MATHEMATICAL NOTATION

The following is the mathematical notation used in this document.

A summation limits are specified next to the symbol , for example:

i=1,T ciTxi

indicates the sum over i for i equal from 1 up to T. If the index on which joins belongs to a set

the sum is expressed as

i ciTxi

stating the sum over elements i which belong to the set .

The conditions of existence of the variables are expressed based on the space to which they

belong. For example

xiR+ i=1,T

It indicates that the vector xi belongs to the space of positive real numbers, and the condition

wS

It indicates that the vector w belongs to a set called S.

2. OPTEX-EXCEL-MMS

Using OPTEX-EXCEL-MMS, the mathematical modelers can implement multi model decision support systems, with no knowledge about computer technologies, also can generate complex models in

several algebraic computer languages linked to any data server that supports ODBCs connections.

2.1. PROCESS

Page 10: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

9

The process to follow is based, in the first instance, to charge the mathematical models in EXCEL, to be subsequently charged to the OPTEX database, and from there proceed to generate computer

programs to solve the math problem linked to problem data, which also will be loaded from an EXCEL

template.

DSSDATABASE DATA MODEL

ALGEBRAIC MODEL

FILLING THEBLANKS

CODE GENERATION

*.CSVFILES

MODEL IN EXCELDATA IN EXCEL

PRIMAL – DUALVARIABLES

OPTEX-EXCEL-MMS

OPTEX-EXCEL-GUI

optexmodel.opx

OPL

FICO™MOSEL

OPTIMIZATION TECHNOLOGY

2.2. OPTEX-EXCEL-MMS TEMPLATE

The EXCEL template is based on an EXCEL workbook comprising multiple sheets, one for each table

that is required to load the elements of the mathematical model. The following image shows an example of a template that is already processed.

Page 11: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

10

Each sheet of the template is a two-dimensional table where the columns corresponding to the table

fields and rows corresponding to data records; with the exception of the first and the second row,

that containing the names and the brief description of the fields.

To complement the information relating to the OPTEX-EXCEL-MMS system the reader can see the following manuals:

http://www.doanalytics.net/Documents/Manual-OPTEX-EXCEL-MMS-Usuario.pdf http://www.doanalytics.net/Documents/Manual-OPTEX-Modelo-Datos-MMIS.pdf

It is important to note that the mathematical models in OPTEX-MMIS is based relational database principles and therefore each type of element/entity/object of the mathematical model is linked to a

master table and a relational code, which allows you to relate all the elements together. As a general rule, the code of an element corresponds to the symbol (string of characters) used in the

mathematical formulation, in everything related to sets, parameters, variables and constraints. When

referring to an element based on its code, OPTEX understood it as the code plus all indexes associated with the element.

In the URL http://www.doanalytics.net/Documents/OPTEX_Plantilla_Modelo_VRP.xlsx is the loaded

template with the VRP model of this tutorial.

2.3. SOLVING PROBLEMS VIA OPTEX-WEB

OPTEX-WEB is a web-oriented interface to access services provided by OPTEX, facilitating the

OPTEX-EXEL-MMS user sending a request of process to solve a mathematical model in an OPTEX OPTIMIZATION SERVER.

To use this service, the user only requires having mathematical models on the OPTEX-EXCEL-MMS template and data in CSV file or an EXCEL template generated by OPTEX. It does not require

installation of OPTEX.

Page 12: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

11

2.4. OPTEX-EXCEL-GUI

All the results of mathematical models can be visualized and analyzed using OPTEX-EXCEL-GUI, which corresponds to a graphical interface in EXCEL, based on dynamic graphs and dynamic tables.

The interested reader can consult the OPTEX-EXCEL-GUI User Manual.

Page 13: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

12

2.5. EXCEL COMPONENTS

To access OPTEX-EXCEL Mathematical Modeling System (OPTEX-EXCEL-MMS) the user only requires to get the components that are part of this product that are:

http://www.doanalytics.net/OPTEX/Download/OPTEX-EXCEL-MMS.ar

The services offered by OPTEX-EXCEL-MMS are:

EXCEL add-ins to connect to OPTEX OPTEX template for implementation of mathematical models using EXCEL

Conversion of EXCEL templates to CSV files (Comma-Separated Values) and vice versa. Access to OPTEX-SERVER located in a DO ANALYTICS server, in the cloud, to solve

mathematical problems Visualization of results using OPTEX-EXCEL-GUI.

To make use of OPTEX-EXCEL-MMS the user does not require installing full OPTEX only EXCEL.

The required components are presented in the following image.

Page 14: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

13

All the elements required to represent mathematical models at OPTEX are organized into relational

tables that can be filled using EXCEL. To begin the process, the user must locate the OPTEX-EXCEL

template OPTEX_Plantilla_Modelos.xlsx in the directory OPTEX/BIN/; if it is not located it you can download it from the URL: http://www.doanalytics.net/Documents/OPTEX_EXCEL_MMS_ES.xlsx

3. THE PROBLEM: ROUTING VEHICLES

For the non-expert reader, interested in learning about the formulation of vehicle routing problems,

we suggest that consulting the following documents:

http://www.doanalytics.net/Documents/OPTEX-Case-An-Inventory-Routing-Problem.pdf http://www.doanalytics.net/Documents/An-Inventory-Routing-Problem.pdf

3.1. GENERAL DESCRIPTION

The problem of routing vehicles in urban areas corresponds to mixed programming model, which, despite being common, is not easy to solve, since it is related to combinatorial problems.

The terminology used in mathematical distribution system modeling is defined:

Vehicle: Medium of transport to be used to provide the services which has a capacity expressed in terms of weight (kg) and volume (m3); and costs, fixed and variables, associated with the use

of the vehicle.

Node: Spot in the geo-referenced map that represents the warehouse, and the clients, these must be visited by a vehicle to provide a service of loading/unloading of goods which have

associated the following characteristics: Amount of goods (demand) of different types of goods to be delivered or collected

Hours of receipt or delivery of goods.

Time averages required for the loading or unloading of the goods.

Restrictions on mobility of vehicles to customers by urban standards or by rules on the client’s

sites

Road Arc: Arch of the road grid that can be used by a vehicle when it is moving between two

nodes. Path: Set of road segments between two nodes.

Page 15: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

14

Route: Sequence of nodes/clients that the vehicle should visit to provide services. Zone: Grouping of nodes whose demand for services should be attended by a set of vehicles

assigned to the zone.

3.2. THE DISTRIBUTION SYSTEM

Mathematical modelling represents the flow of merchandise between the nodes of the distribution

system: warehouse (logistic operator) and clients (c).

The orders (w) of the clients (c) activate the distribution system, these determine the routes and the

allocation of system resources. The logistics operator handles a variety of goods from different customers that are stored in the warehouse (c) contained in boxes (b) and have associated a weight

and volume. For the distribution and transport of goods, the logistics operator has a heterogeneous fleet of vehicles (v), own and third parties, that have associated a load capacity in weight and volume.

Vehicles (v) are involved in a main activity that is the distribution of goods, this activity is to deliver the orders from the warehouse of the logistics operator (c) to the clients (c). The fleet of vehicles

(v) has transit restrictions, what prevents that certain vehicles (v) can go to certain clients (c).

Clientes Bodega Destinatarios Mercancía Mercancía

FLUJO DE MERCANCÍA ENTRE NODOS

The following graphic shows the flow of merchandise between the nodes (c), which is transported in vehicles (v).

DISTRIBUTION SYSTEM

WAREHOUSE

Client 7

Client 8

Client 1 Client 2

Client n

Client 3

Client 4

Client m

Client 5

Client 6

Client p

(c)

(v)

(w)

(k)

(b)

Page 16: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

15

In addition, the vehicles have capacity constraints in volume (m3) and weight (ton).

We considered two problems: a simple VRP model that determines the optimal route of vehicles (sequence of customers to visit) in an area without considering additional restrictions; posteriori, we

include two constraints of capacity, one volume and one of weight are included, this new model is called VRP2C.

4. FORMULATION AND IMPLEMENTATION OF THE VRP MODEL

Given that it is assumed that the formulation of the model was already performed it is assumed that the reader at the beginning of the implementation of the model knows the elements that are part of

this model.

On the other hand, since implementation of the mathematical model in OPTEX implies its storage in

a relational information system, whereas the reader to approach the organization of the formulation of mathematical models from this point of view; therefore, if an information system is a set of

"related" tables it is convenient that the first version of the mathematical model approach is based on tables that contain the different elements that compose the algebraic formulation.

Then the VRP model is presented in the following elements: indexes, sets, parameters, variables,

constraints and objective functions; from the previous concepts is parameterized higher level

elements, such as: problems and models.

SUGGESTION: If the reader considers it convenient, DOA suggests:

1. Load the template of models from the tables included in this document. For this you can download

the WORD version of the tables included in this manual from the URL: http://www.doanalytics.net/Documents/Manual-Tutorial-OPTEX-Implementacion-Modelo-

VRP.rar 2. Review the presentation related to the algebraic language based on tables, exclusive of OPTEX.

To do this you can download the presentation of the URL:

http://doanalytics.net/Documents/OPTEX-Database_Algebraic_Lenguage.pdf

4.1. INDEXES

The entities that are handled in the model must be associated with indexes that represent them in the algebraic formulation. Each type of entity requires at least an index to represent it, when there

are mathematical elements that relate two physical entities of the same type is required to define

indexes "alias" for the correct formulation of the models.

In addition, each index should link a master table that stores the attributes of physical entities

associated with the index; to store the codes assigned to the physical entities, you must define a relational key, which will be the element that establishes the relationships between different tables

that make up the information system of the data of the problem.

Given that a master table can contain physical entities that are not considered in the model, it is necessary to define a reference table containing physical entities to be included in the model, these

tables are called as scenario tables and define the topology of the mathematical model to solve, and therefore are associated with a case or scenario.

Page 17: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

16

Then the indices used are:

INDEXES

INDEX ENTITY OBJECT

DESCRIPTION ALIAS MASTER TABLE

SCENARIO TABLE

RELATIONAL KEY

b Boxes Container in which it is protected, stored and transported merchandise

BOXES ESC_CAJ COD_CAJ

c Node Spatial point that must be visited by a vehicle to provide a service of loading and/or unloading of goods

k NODES ESC_NOD COD_NOD

k Node (Alias)

Spatial point that must be visited by a vehicle to provide a service of loading and/or unloading of goods

c NODES ESC_NOD1 COD_NOD1

v Vehicle Transport equipment to be used to provide transportation services

VEHICLES ESC_VEH COD_VEH

w Orders Custom merchandise that customers make and must be shipped and transported

ORDERS ESC_PED COD_PED

The following image presents the index information loaded in the EXCEL template (sheet INDEXES).

In this case we have included additional information corresponding to the type of index (COD_TIN),

which is A (alphanumeric) for all cases.

4.2. VARIABLES The variables of the problem are associated with the decisions the final user of the mathematical models. In this case the modeled decisions are:

Activation of the service for a vehicle.

Order of visit of vehicles to the destination.

Below, is the set of required binary variables:

Page 18: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

17

VARIABLES

VARIABLE DESCRIPTION MEASURE

UNIT TYPE

EXISTENCE CONDITIONS

AVLv

Using vehicle v Binary variable that determines whether to use the vehicle v to meet the orders of customers. Exists for all vehicle v in the problem, which is represented by the set vVEH.

B vVEH

VCLv,c,k

Vehicle v goes from c to k Binary variable that determines if the vehicle goes from the node origin c to node destination k. Exists for all vehicle v in the problem, all client c that can be attended by the vehicle v (cNCV(v)) and by all node

k which can be visited from the node c in vehicle v (kTRK(c,v))

B

vVEH

cNCV(v) kTRK(c,v)

The conditions of existence of a variable determines the values of combinations of indexes (physical entities) for which the variable exists and is determined based on the sets that define them.

The definition of the variables implies filling two tables:

The first (sheet VARIABLE) which determines the general attributes of the variable

The second (sheet VAR_IND) to define the indexes of variables and their conditions of existence.

Page 19: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

18

4.3. CONSTRAINTS

The constraints required to model the problem VRP (highlighted in gray shape as it should be implemented in OPTEX, which implies the grouping to the left side of all the terms that contain

variables, on the right side must be a parameter or a constant value) are:

CONSTRAINTS – MODULE: VRP

CONSTRAINT DESCRIPTION- EQUATION UNIT

SANOv,c Departure from the origin node Establishes that any vehicle v used should leave the origin node c (warehouse) in which it is located.

kTRK(c v) VCLv,c,k = AVLv

kTRK(c v) VCLv,c,k - AVLv = 0

vVEH cNOV(v)

Exists for all vehicle v (vVEH) and for the node source c in which is located the

vehicle v (cNOV (v)).

Sets: TRK(c,v) Customers k you can visit from c in vehicle v VEH Vehicles v NOV(v) Warehouse c in which is located the vehicle v Variables: VCLv,c,k Determines if a vehicle v goes from customer c to customer k AVLv Determines the use of a vehicle v

ENSAv,c Arrival and departures of a node It establishes that any vehicle that visits to a destination should leave this

kTRK(c,v) VCLv,k,c = kTRK(c,v) VCLv,c,k

kTRK(c v) VCLv,k,c - kTRK(c v) VCLv,c,k = 0

vVEH cNCV(v)

Page 20: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

19

CONSTRAINTS – MODULE: VRP

CONSTRAINT DESCRIPTION- EQUATION UNIT

Sets: TRK(c,v) Customers k you can visit from c in vehicle v VEH Vehicles v NCV(v) Customer c it can meet the vehicle v Variables: VCLv,c,k Determines if a vehicle v goes from customer c to customer k

UTVEv Use of vehicles It establishes that only if the vehicle v is used can make travel between nodes c and k.

cNCV(v) kTRK(c,v) VCLv,c,k ≤ ∞ × AVLv

cNCV(v) kTRK(c,v) VCLv,c,k - ∞ × AVLv ≤ 0

vVEH

Exists for each vehicle v (vVEH ). Sets: NCV(v) Customers c that can be meet with the vehicle v TRK(c,v) Customers k you can visit from c in vehicle v VEH Vehicles v Variables: VCLv,c,k Determines if a vehicle v goes from customer c to customer k AVLv Determines the use of a vehicle v

VCLIc Visit of destination Set at least one vehicle v visit customer c.

vVEC(c) kTRK(c,v) VCLv,c,k = 1

cDEC

Exists for any client that should be visited c ( cNOV(v) ).

Sets: VEC(c) Vehicles v that can meet the client c TRK(c,v) Customers k you can visit from c in vehicle v DEC Customers c Variables: VCLv,c,k Determines if a vehicle v goes from customer c customer k

CAPPv Load capacity vehicles Sets that demand covered by the vehicle weight cannot be greater than its capacity in weight.

cNCV(v) kTRK(c v) DEMPc × VCLv,c,k ≤ CAPPv

vVEH

Sets: NCV(v) Customers c that can be meet with the vehicle v TRK(c,v) Customers k you can visit from c in vehicle v VEH Vehicles Parameters: DEMPc Weight of the customer's order c (kg) CAPPv Capacity of the vehicle in weight (kg) Variables: VCLv,c,k Determines if a vehicle v goes from customer c customer k Parameter DEMPc parameter associated with the weight of the order to deliver client c is calculated as:

kg

Page 21: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

20

CONSTRAINTS – MODULE: VRP

CONSTRAINT DESCRIPTION- EQUATION UNIT

DEMPc = bCAC(c) NUCDc,b × PECAb

Sets: CAC(c) Boxes (b) that are part of the order of the client c Parámetros: NUCDc,b Amount of boxes type b should be released for customer c (und) PECAb Weight boxes type b (kg)

CAPVv Volumetric capacity of vehicles Sets that demand covered by the vehicle weight cannot be greater than its capacity in volume.

cNCV(v) kTRK(c v) DEMVc × VCLv,c,k ≤ CAPVv

vVEH

Sets: NCV(v) Customers c that can be meet with the vehicle v TRK(c,v) Customers k you can visit from c in vehicle v VEH Vehicles v Parameters: DEMVc Order volume of customer c (m3) CAPVv Capacity of the vehicle v in volume (m3) Variables: VCLv,c,k Determines if a vehicle v goes from customer c customer k The parameter DEMVc parameter associated with the volume of the order to deliver client c is calculated as:

DEMVc = bCAC(c) NUCDc,b × VOCAb

Sets: CAC(c) Cajas b que hacen parte del pedido del cliente c Parameters: NUCDc,b Cantidad de cajas tipo b que deben ser despachadas al cliente c (und) VOCAb Volume of boxes type b (m3)

m3

The definition of the constraints implies filling three tables:

• The first (RESTRICC) which determines the general attributes of the constraints; it includes the definition of the RHS (right hand side) and LHS (left hand side) of the constraint.

Page 22: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

21

The second (RES_IND) to define constraints indexes and their conditions of existence.

The third (ECUACION) which contains the terms that break down every equation of the the

constraints of the model. Given that this process is the "hardest" of the template, then, the accomplished process is analyzed restriction by restriction, previously it is presented the basic

rules of algebraic language of OPTEX.

4.4. DATABASE ALGEBRAIC LANGUAGE

Page 23: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

22

An algebraic language based on tables is used to describe the elements that integrate the equation.

For simplicity of presentation, it should be noted that this document describes only related to linear

models as the VRP; however, it should be noted that the capabilities of the OPTEX database language allows the formulation of any non-linear expression.

Conceptually, an equation is considered as the sum of multiple terms each of which has five

components: SEQ

SIGN

COMPONENT 1 COMPONENT 2

COMPONENT 3

Below, each component is described.

SEQ: determines the sequence of the terms of the equation.

SIGN: determines if the evaluated expression will be multiplied by 1 or -1 after being

evaluated.

COMPONENT 1

The COMPONENT 1 can be:

SUM, or S or : indicates that a sum is open. The elements on which the sum will be

shown in COMPONENT 2.

Numerical value: for a constant numeric value (example: 1 or 43.56) Parameter: corresponding to the value of a parameter, or a function of a parameter,

which must be multiplied by the COMPONENT 2. The parameter subscripts are assumed

to be equal to those defined for the parameter.

COMPONENT 2 The COMPONENT 2 can be:

Limits of the sum: corresponds to an expression that contains the information about the

elements that should be included in the sum. The first element corresponds to the index that the sum will be held. The second corresponds to the set of reference to select the

values of the index, the element should separate from the index using a slash (/). Alphanumeric index set is defined based on the code of the set. For numeric indices (for

example, the index t), the set is defined by the limits to which will vary the index, separated

by a comma, in this case the / is replaced by an equal sign (=). Parameter: corresponding to the name/code/ID of a parameter, or a function of a

parameter, which must be multiplied by the COMPONENT 1. It is only applicable for formulas related parameters. The parameter subscripts are assumed to be equal to those

defined for the parameter. Variable: corresponding to the name/code/ID of a variable that has to be multiplied by

the COMPONENT 1. The subscripts of the variable are assumed to be equal to those

defined for the variable. Where subscript varies with respect to its definition must specify parameters value that takes. It only applies to equations of variables.

COMPONENTE 3

The COMPONENT 3 is not required for linear models.

Page 24: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

23

CONSTRAINTS- VRP MODEL

CONSTRAINT DESCRIPTION- EQUATION

SANOv,c Departure from origin node

kTRK(c,v) VCLv,c,k - AVLv = 0

vVEH cNOV(v)

SIGN COMPONENT 1 COMPONENT 2

+ S k/TRK + 1 VCL - 1 AVL

ENSAv,c Arrival and departures of a node kTRK(c,v) VCLv,k,c - kTRK(c,v) VCLv,c,k = 0

vVEH cNCV(v)

SIGN COMPONENT 1 COMPONENT 2

+ S k/TRK + 1 VCL - S k/TRK + 1 VKL

Given the equation relates the variable VCLv,c,k from two points of view: flow from c to k and k to c flow, in OPTEX is considered necessary the inclusion of the concept of ALIAS to represent the variable when you have the indexes in different order, in this case the name given to the alias is VKLv,k,c which allows to formulate the equation without having to specify the indexes.

UTVEv Use of vehicles cNCV(v) kTRK(c,v) VCLv,c,k - ∞ × AVLv ≤ 0

vVEH

SIGN COMPONENT 1 COMPONENT 2

+ S c/NCV + S k/TRK + 1 VCL - INFI AVL

VCLIc Visit of destination vVEC(c) kTRK(c,v) VCLv,c,k = 1

cDEC

SIGN COMPONENT 1 COMPONENT 2

+ S v/VEC + S k/TRK + 1 VCL

CAPPv Load capacity of vehicles cNCV(v) kTRK(c v) DEMPc × VCLv,c,k ≤ CAPPv

vVEH

SIGN COMPONENT 1 COMPONENT 2

+ S c/VEC + S k/TRK + DEMP VCL

CAPVv Volumetric capacity of vehicles cNCV(v) kTRK(c v) DEMVc × VCLv,c,k ≤ CAPVv

vVEH

SIGN COMPONENT 1 COMPONENT 2

+ S c/VEC + S k/TRK + DEMV VCL

Page 25: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

24

The following image shows the parameterization of the constraints in ECUACION table.

SUGGESTION:

Download from the following URL presentation describing the mathematical formulation in OPTEX using algebraic language supported on the concepts of information systems:

http://doanalytics.net/Documents/OPTEX-Database_Algebraic_Lenguage.pdf

4.5. VARIABLES ALIAS

Given that the ENSAc,v equation, relates the variable VCLv,c,k from two points of view: flow from c

to k and flow from k to c, requires considered the inclusion of the concept of ALIAS to represent the variable when it is necessary to have the indexes in different order.

Below, the variables alias required:

VARIABLES

VARIABLE DESCRIPTION ALIAS EXISTENCE

CONDITIONS

VKLv,k,c

Binary variable alias for VCLv,k,c which determines if the vehicle goes from the origin k node to destination node c

Exists for every vehicle v considered in the problem, every customer k which can be attended by the vehicle v kNKV(v)) and by every node c which can be visited

from the node c in vehicle v (kTRC(k,v) )

VKLv,c,k

vVEH kNKV(v)

cTRC(k,v)

The definition of variables alias implies filling two tables/sheets:

The first (ALIAS) that determines the general attributes of the variable alias

Page 26: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

25

The second (IND_ALIA) to define the variable alias indexes and their conditions of existence.

4.6. OBJECTIVE FUNCTIONS

The objective of the optimization in the VRP model can be of different types according to the criteria

of the planner. In this case is the minimization of the total operation costs that are integrated by the fixed costs of use of vehicles plus vehicles travel costs.

The following table presents the summary of the mathematical formulation.

Page 27: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

26

OBJECTIVE FUNCTIONS

OBJECTIVE FUNCTION

DESCRIPTION - EQUATION UNIT

CFIT Fixed cost for used vehicles It corresponds to the sum of the fixed costs associated with vehicles that are activated

CFIT = vVEH CFIJv × AVLv

Sets: VEH Vehicles v Parámetros: CFIJv Fixed cost of vehicle v Variables: AVLv Determines the use of a vehicle v

$

CVAT Variable cost for used vehicles It corresponds to the sum of the variable costs to use vehicles to meet customers

CVAT = vVEH cNCV(v) kTRK(c,v) CVIAv,c,k × VCLv,c,k

Sets: NCV(v) Customers c that can be meet with the vehicle v TRK(c,v) Customers k you can visit from c in vehicle v VEH Vehicles v Parameters: CVIAv,c,k Cost of meet a client k from the node c with the vehicle v ($) Variables: VCLv,c,k Determines if a vehicle v goes from customer c customer k The cost-per-trip CVIAv,c,k, is calculated as:

CVIAv,c,k = COVAv × DISTc,k

COVAv Cost per kilometer of vehicle v ($/kmt) DISTc,k Distance between the node c and the node k (kmt) COVAv Cost per kilometer of vehicle v ($/kmt) DISTc, Distteance between the node c and the node k (kmt)

$

CTOT Total cost of operation of the system

CTOT = CFIT + CVAT

$

The implementation of the equations related to the objective function requires three tables:

The first (FUNOBJ) which determines the general attributes of the objective functions. The template, which is presented below, includes the classification of the objective function type:

SIM, which implies that it is a basic equation that sum the variables multiplied by its

corresponding cost and MUL involving the weighted sum of objective functions, single or multiple.

Page 28: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

27

The second (VAR_OBJ) that defines the relationships between variables and their costs in

objective function, including the sign in the sum.

The third (FOB_FOB) that define the relationship between objective functions, including a

weighting factor, which in conventional objective functions is equal to 1.

Page 29: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

28

4.7. PARAMETERS

The parameters of the models must configure, associating them with a name/code that is used in the equations of the mathematical model. The value of a parameter can be set in two ways:

From the data contained in the information system tables; and

As a result of the evaluation of an equation that involves other parameters, so that the user does not have to perform manual calculations.

The parameters read are presented in the following table, including the table and the field that contains the numeric data.

BASIC PARAMETERS

PARAMETERS DESCRIPTION UNIT TABLE FIELD

CAPVv Capacity of the vehicle in volume Volumetric capacity of the vehicle, measured in cubic metres

m3 VEHICULOS CAPV

COVAv Variable costs for using a vehicle v Cost per kilometer by using the vehicle

$/kmt VEHICULOS COVA

CFIJv Fixed costs for using a vehicle v Fixed cost of use vehicle v

$/día VEHICULOS CUVE

DISTc,k Distance nodes Distance between the origin node and the destination node

km NOD_NOD DIST

NUCAw,b Number of boxes of order Number of boxes order that must be transported to the node

und PED_CAJ NUCA

PECAb Weight box Weight in kg of boxes

kg CAJAS PECA

VOCAb Volume of boxes Volume of the boxes in cubic meters

m3 CAJAS VOCA

The calculated parameters are summarized in the following table

CALCULATED PARAMETERS

PARAMETER DESCRIPTION UNIT

CVIAv,c,k Cost of travel between nodes $

Page 30: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

29

CALCULATED PARAMETERS

PARAMETER DESCRIPTION UNIT

Cost of travel of the vehicle from origin node to the destination node

CVIAv,c,k = COVAv × DISTc,k

Parameters: COVAv Cost per kilometer of vehicle v ($/kmt) DISTc,k Distance between the node c and the node k (kmt)

DEMPc Demand in weight The node demand expressed in kilograms

DEMPc = bCAC(c) NUCDc,b × PECAb

Sets: CAC(c) Boxes (b) that part of the order of the client c Parameters: NUCDc,b Amount of boxes type b should be released for customer c (und) PECAb Weight boxes type b (kg)

kg

DEMVc Demand in volume Demand for the node, expressed as a volume

DEMVc = bCAC(c) NUCDc,b × VOCAb

Sets: CAC(c) Boxes (b) that part of the order of the client c Parameters: NUCDc,b Amount of boxes type b should be released for customer c (und) VOCAb Volume of boxes type b (m3)

m3

The definition of the parameters involves filling three tables:

The first (PARAMETR) which determines the general attributes of the restriction

Page 31: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

30

The second (PAR_IND) defines indexes of parameters

The third sheet (ECUACION) contains the terms that break down every equation of the

parameters of the model. Algebraic language is the same as described previously for the restrictions. EQUATION table stores the equations of constraints (green background) and the

parameters (blue background).

4.8. SETS

Page 32: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

31

The sets determine the conditions of existence of the variables, the constraints and the problems, as

well as the limits of the sums that make part of the equations of formulas for calculation of parameters

and restrictions. The sets determine the topology of the system that is modeling. Two types of sets are:

PRIMARY SETS: Directly defined from the data contained in the tables of information system; and

SECONDARY SETS: They result from operations between sets.

The sets contain elements whose class is defined by the so-called dependent index that can be

indexed based on the value of other indexes that act as independent indexes.

The following tables present the basic and calculated sets employed in models. In the definition of the set is presented in parentheses independent indexes and previously the dependent index, which

determines the type of the entities/objects that contains the set.

In the definition of a read set it is necessary to fill the table and the field that contains the parameter,

and, in some cases, the filter to applied to the table to select the element of the set

BASIC SETS

SETS DESCRIPTION TABLE ELEMENT

FIELD FILTER

bCAP(w) Cajas - > Pedido

Cajas que se utilizan para el almacenamiento y transporte de la mercancía.

PED_CAJ COD_CAJ

cDEC Destinos c Nodos a los cuales se despacha la mercancía.

NODOS COD_NOD TIPO=DES

cNCV(v) Nodos c <- Vehículos Nodos a los cuales pueden ir el vehículo para atender pedidos.

VEH_NOD COD_NOD

cNOC(k) Nodo Origen -> Nodo Destino Nodos origen que se pueden conectar con el nodo destino.

NOD_NOD COD_NOD DIST<30

cNOD Nodos Nodos a los cuales se les debe prestar un servicio de carga y/o descarga mercancías

NODOS COD_NOD

cNOV(v) Nodo Origen <- Vehículos Nodo origen en el que está ubicado el vehículo.

NOR_VEH COD_NOD

kDEK Destinos k Nodos destino a los cuales se despacha la mercancía.

NODOS COD_NOD TIPO=DES

kNKV(v) Nodes k <- Vehículos Destination nodes which can go the vehicle to meet orders.

VEH_NOD COD_NOD

kNOK(c) Destination Node k -> Origin Node c Nodos destino que se conectan con un nodo origen.

Origin nodes connected with a destination node.

NOD_NOD COD_NOD1 DIST<30

vVEH Vehicle

Used vehicles to collect and distribute the merchandise from and to clients

VEHICULOS COD_VEH

vVEK(k) Vehicles -> Destination Nodes k Vehicles that can go to destination node to meet orders

VEH_NOD COD_VEH

wPEC(c) Order -> Customer Order that can ship to the node

PEDIDOS COD_PED

vVEC(c) Vehicles -> Nodes Vehicles that can go to the node to meet orders

T(NCV/c) COD_VEH

In the definition of a calculated set, it is necessary to define the operation that generates the set; normally an equation for a set includes two sets, but, for some operations, is possible to formulate

a chain of operations, of the same type, between multiples sets. It is the case of intersections and of union of sets.

The formulation of VRP model only consider two types of operations: intersection (I) and super-union (S). But, OPTEX has implemented multiples type of operations that can be study in the

Administrator Manual of OPTEX.

Page 33: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

32

CALCULATED SETS

SET DESCRIPTION OPERATION

bCAC(c) Boxes that must be transported to the node Boxes that must be transported to the node.

SUwPEC(c) CAP(w)

cTRC(k,v) Roads on which vehicle can travel Nodes from which you can go to the destination node using the

vehicle.

NCV(v) NOC(k)

kDKC(c) Destinations k -> Destination c

Nodes from which you can go (connected) to another node DEK NOK(c)

kTKD(c,v) Roads on which can move the vehicle (destinations)

Destination nodes from which you can go to the node using the vehicle.

TRK(c,v) DEK

kTRK(c,v) Roads on which vehicle can travel Destination nodes from which you can go to the node using the

vehicle.

NKV(v) NOK(c)

vVET(c,k) Vehicles that can travel on the road

Vehicles that can go from the origin node to the destination node. VEK(k) VEC(c)

To parameterize sets in OPTEX is required to fill two tables

The first (CONJUNTO) that contains the general attributes of the sets.

The second (CON_IND) that contains the independent indexes of the set and the reference set

that must be used to reference when an empty validation is required.

4.9. PROBLEMS

Once all the structural elements have been defined then you must set models that you can/want to

resolve, each one has associated with it a set of constraints that define it. Then general VRP presents two problems associated with the problem formulation, both belong to the MIP (Mixed Integer

Programming) format.

VRP PROBLEMS

CODE/ID DESCRIPTION FORMAT

PROBLEM

RESTRICTION

BASICS WEIGHT

Page 34: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

33

VOLUME

VRP Vehicle Routing (VRP) MIP ENSA UTVE NOCL VCLI SANO

VRP2C Vehicle Routing (VRP) - Weigth + Volume MIP CAPP CAPV

The problem definition involves filling four tables, the VRP only uses two of them.

The first (PROBLEM) which determines the general attributes of the problem. In this table has been filled the role of the problem which is IN (integrated).

The second (PRO_RES) defines the restrictions that are included into the problem. The field

ORDER_MOD is optional and it is related whit the order of the constrains in the matrix of constraints; it may be useful in MIP models.

Page 35: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

34

4.10. MATHEMATICAL MODELS

Finally, you must define the models considered in the application VRP, it implies to specify the problems that make up each model. In this case two models, one for each defined problem, are as

shown in the following table.

MODEL ID

DESCRIPTION PROBLEM

ID

VRP Vehicle Routing (VRP) VRP

VRP2C Vehicle Routing (VRP) - Weigth + Volume VRP2C

The definition of the models involves filling two tables:

The first (MODEL) which determines the general attributes of each model. In this table, the type

of model has been filled as integrated (I), which implies that model corresponds to a unique mathematical problem.

Page 36: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

35

The second (MOD_PRO) defines the problems that belong to the model:

5. INDUSTRIAL DATA INFORMATION SYSTEM

Subsequent to the completion of the formulation of the mathematical model should be defined the data model of the information system of industrial data (IDIS). Three tables must be defined for this

purpose:

Tables of the IDIS (CDBAS)

Page 37: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

36

Fields of the Tables of IDIS (DDBAS) Relational fields (CAMRE)

These tables are included in the OPTEX-EXCEL-MMS template.

This process involves collecting all the information of the data model that is storage in all tables used

in the mathematical formulation. Because the data model is fully defined in tables presented previously, in the near future OPTEX will "generate automatically" the tables that are required.

The data corresponding to the technical information of urban routing VRP model are classified into

two types:

Permanent Data: pertaining to technical information of the system that is independent of any scenario; and

No Permanent Data: associated to the existence or not of a scenario and representing its variability.

In the information system are stored as "input values" the parameters and the elements of the sets, and as "output values" the solutions for variables and for constraints (primal variables and dual

variables), and, when the user specifies, tables for sets and the parameters udes in the model.

5.1. RELATIONAL KEYS

To make easy the services that may be provided by OPTEX for organizing information, in different

forms, the table CAMRE that defines the relational keys must be filled; information that can be extracted from the tables related to the INDICES used in the mathematical model.

RELATIONAL FIELDS (KEYS)

RELATIONAL KEY

OBJECT ENTITY

MASTER TABLE TYPE LENGTH

COD_CAJ Boxes ID CAJAS C 15

COD_NOD Node ID NODOS C 15

COD_NOD1 Node ID (Alias) NODOS C 15

COD_VEH Vehicle ID VEHICULOS C 13

COD_PED Order ID PEDIDOS C 7

Below, is an image of the CAMRE table.

Page 38: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

37

5.2. DATA TABLES

The data model is implemented from the definition of the master tables for each of the entities included in the VRP, and secondary tables that allow detailed characteristics of each entity, and

make it possible to establish the necessary relationship between the entities to represent the topology of the system. The scenario tables store the physical entities that will be incorporate in the model.

The tables that are part of the VRP are presented below:

TABLES OF VRP - INDUSTRIAL DATA INFORMATION SYSTEM

TABLE DESCRIPTION PATH AREA

RELATIONAL CODES

SECONDARY CODES

SETS PARAMETERS

MASTER TABLES CAJAS Boxes Master I COD_CAJ PECAb, VOCAb

DIAS Days Master I COD_DIA

NODOS Nodes Master I COD_NOD DEC, NOD, DEK TSERc

PEDIDOS Orders Master F COD_PED COD_NOD PEC(c)

VEHICULOS Vehicle Master I COD_VEH VEH CAPPv, CAPVv,

COVAv, CUVEv

SECONDARY TABLES

NOD_NOD Nodes <-> Nodes I COD_NOD, COD_NOD1

NOK(c), NOC(k) DISTc,k

NOR_VEH Node Origin <-> Vehicles

I COD_NOD, COD_VEH

NOV(v)

PED_CAJ Order <-> Boxes F COD_PED, COD_CAJ

CAP(w) NUCAw,b

VEH_NOD Vehicles <-> Nodes I COD_VEH, COD_NOD

NCV(v), VEC(c), NKV(v), VEK(k)

VEHICULOS Vehicle Master I COD_VEH VEH

SCENARIO TABLES ESC_CAJ Scenarios Boxes F COD_CAJ

ESC_DIA Scenarios Days F COD_DIA

ESC_NOD Scenarios Nodes F COD_NOD, COD_NOD1

ESC_PED Scenarios Orders F COD_PED

ESC_VEH Scenarios Vehicles F COD_VEH

Page 39: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

38

The above information is the basis for filling the CDBAS table whose image is presented below, in that table the following fields have been filled:

TIPO_FILE: M, master or S secondary PATH_DB: I, permanent data area (Industrial), F, family of scenarios or E scenarios.

5.3. STRUCTURE OF THE TABLES

Below, the structure of the data tables that are part of the information system is presented; previously

it is presented the description of the columns in the table.

COLUMNS FIELDS OF TABLES

COLUMN DESCRIPTION

TABLE Code (name) Table

FIELD Field code; by default, assumes codes up to ten (10) characters

DESCRIPTION Description of the contents of the field, which is used in the automatic generation of prototypes and in the titles

of windows when you access the data in form mode.

TYPE

Type of field, may be one of the following: C Alphanumeric character

N Numeric D Date M Memo

UNIT Unit measure code

LENGTH Length of field

DECIMAL Number of decimals of the field (for numeric fields)

VALIDATION Validation function. The following are types of validations: A Referential integrity.

D Validation for duplicity of content of a key in a tables

VALID 1 Parameter 1 of a validation function

VALID 2 Parameter 2 of a validation function

The structure of the tables is presented below:

Page 40: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

39

FIELDS OF DATA TABLES

TABLES FIELD DESCRIPTION TYPE LENGTH DE

CIMAL UNIT VALIDATE

VALID 1

VALID 2

DSS

CAJAS COD_CAJ Code boxes C 15 0 D

DES_CAJ Box description C 10 0 D

PECA Weigth of boxes N 8 3 kg Si

VOCA Volumen of boxes N 7 4 m3 Si

ESC_CAJ COD_CAJ Code boxes C 15 0 A CAJAS COD_CAJ

ESC_DIA COD_DIA Day Code C 4 0 A DIAS COD_DIA

ESC_NOD COD_NOD Node code C 15 0 A NODOS COD_NOD

COD_NOD1 Node code (Alias) C 15 0 A NODOS COD_NOD

ESC_PED COD_PED Order code C 13 0 A PEDIDOS COD_PED

ESC_VEH COD_VEH Vehicles code C 7 0 A VEHICULOS COD_VEH

HORARIO COD_NOD Node Code C 15 0 A NODOS COD_NOD Si

COD_DIA Day code C 4 0 A DIAS COD_DIA Si

HAPE Open hour N 10 3 hr Si

HCIE Closed hour N 10 3 hr Si

NOD_NOD COD_NOD Node code C 15 0 A NODOS COD_NOD Si

COD_NOD1 Node code (Alias) C 15 0 A NODOS COD_NOD Si

DIST Distance between nodes N 6 2 Km Si

NODOS COD_NOD Code node C 15 0 D Si

DES_NOD Description node C 30 0 D

TIPO Type of node C 3 0 Si

NOR_VEH COD_NOD Origin node code C 15 0 A NODOS COD_NOD Si

COD_VEH Vehicle code C 7 0 A VEHICULOS COD_VEH Si

PED_CAJ COD_PED Order code C 13 0 A PEDIDOS COD_PED Si

COD_CAJ Boxes code C 15 0 A CAJAS COD_CAJ Si

NUCA Number of boxes of order N 3 0 Und Si

PEDIDOS COD_PED Order code C 13 0 D Si

DES_PED Order description C 30 0 D

COD_NOD Code node C 15 0 A NODOS COD_NOD Si

VEH_NOD COD_VEH Vehicle code C 7 0 A VEHICULOS COD_VEH Si

COD_NOD Node code C 15 0 A NODOS COD_NOD Si

VEHICULOS COD_VEH Vehicle code C 7 0 D Si

DES_VEH Vehicle description C 30 0 D

CAPP Load capacity N 7 2 kg Si

CAPV Volume capacity N 8 2 m3 Si

CUVE Use cost of vehicle N 10 2 $/día Si

COVA Variable cost N 10 3 $/km Si

Below, is the image of the table DDBAS in EXCEL.

5.4. LOADING OF TABLES OF THE IDIS

Page 41: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

40

The industrial data base required to solve the problem of VRP has organized a book/template EXCEL

that contains all the tables defined in the preceding paragraphs, this template is located at:

http://www.doanalytics.net/Documents/OPTEX_Plantilla_Data_VRP.xlsx. The following image shows the template generated by OPTEX for loading the data.

5.5. SCENARIOS

In the EXCEL template, the configuration of the mathematical model runs is via the definition of scenarios (table/sheet ESCENARI)

Associated to a family of scenarios you must define the following information:

Scenario: code given to the scenario.

Description: Description. Model: Mathematical model.

Planning horizon: the horizon of planning code (not required for the VRP model). Objective Function: Code of the function objective

Type of Optimization: maximize, minimize, Minimax or Maximin. Initial Date: Date initial scenario (t=0). OPTEX all models handled it with a defined time

reference).

Initial Hour: Start time (t=0). Necessary when planning horizon is managed in hours.

Page 42: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

41

All the tables needed to make a run from OPTEX-EXCEL-MMS template via OPTEX-WEB are

available at this time.

5.6. EXPORT/IMPORT OF TEMPLATES EXCEL

As part of the files that integrated OPTEX-EXCEL-MMS are the oriented to conversion of templates

to CSV files and otherwise, build templates from CSV files. This incorporates two EXCEL macros that users install on their PC to link them to icons in EXCEL. These components,

OPTEX_Exportar_Plantilla_a_CSV.xla and OPTEX_Importar_Plantilla_de_CSV.xla, are

located in the directory /BIN/ or in OPTEX-EXCEL-MMS download file. To install the components as permanent parts of EXCEL we must perform the following procedure:

1. Install the components in the directory of plug-ins of Microsoft which facilities for "typical" on the disk c: is located in the following directory: c:/Users/user/AppData/Roaming/Microsoft/AddIns.

2. Install the components as permanent parts of EXCEL for it should go to the file menu and select options, Excel Options window choose the option Add-ins.

Page 43: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

42

3. In the Manage box, select Excel add-ins and click Go button...

4. Select Add-ins:

OPTEX_Exportar_Plantillas_CSV OPTEX_Importar_Plantillas_CS

V

5. Click on the OK button

6. Go back to the file menu, select options, in Excel Options window choose the Quick Access toolbar.

7. In the box Available Commands, select

Macros:

Page 44: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

43

8. In the box Customize Quick Access toolbar must be selected the option for all documents

9. Select macros and add them using the Add >> button

10. The icon associated with each macro can be changed by clicking the modify button ... select the icon that you want to represent to the macros.

Page 45: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

44

11. After change the icon that represents the macro should click OK in the Excel Options window, at the end of the process on the Quick Access toolbar should appear the icons associated with macros.

To convert the template into CSV files is necessary to define the following parameters:

1. Define the field delimiter in the CSV file 2. Indicate if the template contains descriptions in the second row of each sheet

3. Select the directory where the CSVs files should be located

6. LOAD OF MODEL AT OPTEX-MMIS

This numeral is oriented to the user that has OPTEX installed in his PC.

Below, it is analyzed the process of loading the VRP model into the Information System of

mathematical models of OPTEX (OPTEX-MMIS), so the user must have installed OPTEX on his computer.

The process of loading the existing information in the EXCEL to OPTEX-MMIS template can be in

multiple ways:

Manually: in this case the user loads each table stored in EXCEL, to do this creates tables in CSV format, eliminating the second row, and imports them to OPTEX-MMIS.

1

2

3

Page 46: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

45

Automatically: in this case used a service from OPTEX that allows to import all tables from the book with a single click.

Given the didactic nature of this document, the first method should be used in a way such that the user becomes familiar with the different windows of work and the services offered by OPTEX in each

of them.

6.1. ACCESS TO OPTEX-GUI

An OPTEX application called EMPTY, which can be used to load the VRP model in OPTEX, was

included in the installation process of OPTEX.

To access such application should be login to OPTEX-GUI under the EMPTY user name. The user must activate the program OPTEX_GraphicsUsersInterface.EXE, located in the directory /BIN/.

The login process will give the user access to a browser window of OPTEX from which you will have

access to exploration of OPTEX-GUI menu, from there you can access the menu of exploration of

Page 47: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

46

mathematical models and data model menu, which give access to the tables that handle the corresponding to those existing in the EXCEL workbook; as presented in the following image. The

load of elements at OPTEX-MMIS will be following the same order of loading of EXCEL tables.

OPTEX-GUI allows access to the four areas of application data:

Data Model Mathematical models

Permanent Industrial System Scenarios of Industrial System

The load of model the user must access to the so-called Mathematical Models area, where you can access the tables associated with mathematical models and the tables associated to the data

model, working in three sub-areas:

Mathematical Models o Mathematical Definitions

o Advanced Concepts Data Model.

The reader must take into account that by default OPTEX works using tables in DBase format, and

that it is therefore convenient to understand management given to this type of table, explained in

section 1 of the present document.

Page 48: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

47

Additionally, for importing data should be aware that the process is slightly different for master tables and for secondary tables. You can import master tables without problem from any shell/container

window that is related to the master table as main table; for the secondary tables they must be

access from shell window that have as main data window the secondary table; therefore, a secondary table CAN NOT be imported from a window container that has as main data window a master

window; this failure is due to secondary tables, that are opened from a master table, have filters that reject records that do not comply with this filter. To handle this situation, it is available at OPTEX of

menus that give you direct access to secondary tables, so that the user makes use them when convenient.

6.2. LOADING THE MMIS

To load the tables related to the mathematical models the user should access the corresponding menus which are displayed in the following images (the menus on the left correspond to accesses to

the master tables of mathematical elements/objects, and those on the right to access to secondary

tables, this menu can be accessed from the menu of the master tables); in the case of tables associated with the data model, all tables, master and secondary, they are accessed from the same

menu.

MATHEMATICAL DEFINITIONS

ADVANCED CONCEPTS

DATA MODEL

6.2.1. INDIVIDUAL LOAD

For the individual import of a table it is suggested to follow the following procedure, the table is taken

as an example the table INDICES.

Page 49: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

48

1. Locate the table in the models template

2. Create a new EXCEL book

3. Copy the table to the new book. You must delete the second row

4. Save the tables as a

.CSV file It is suggested to use the same name of the sheet of the template

Page 50: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

49

5. Locate the destination table in the explorer of OPTEX-GUI

6. Open the DBF table in OPTEX-GUI

7. Import the tables based on the service Import a text file

8. Check the loaded table in DBF format

6.2.2. MASSIVE LOAD

Alternatively, and in a more effective way, it is possible to load all the information contained in the

EXCEL template, in one step, via of a specialized service of OPTEX for this purpose which is accessed via the right-click on the mouse when you are in the Explorer Menu of the mathematical models.

Page 51: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

50

For this purpose, all CVSs tables should be located in the same directory with names equal to the

sheets of the EXCEL template, which you can do with the OPTEX complements to export EXCEL

templates to files CVSs. The user must choose the delimiter with which CVSs files were created, in this aspect should be careful in the drafting of the long descriptions, since they may contain common

delimiters as the comma, semicolon,..., this confusion can cause errors in loading data; in this process has been used comma as it a delimiter.

OPTEX will load from CSV files and generate a report of errors in the load.

Page 52: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

51

Subsequently, OPTEX will check the structure and the data store in the tables to verify the integrity

of the MMIS; process report is located in the INPUT_CHECK_DSS. LOG file in the work directory

of the OPTEX application; which can review with any text editor, e.g. NOTEPAD.

In this case uploaded a template that contains errors which should be corrected by the user; which

can be done directly in the template or in the OPTEX-GUI interface. The template that produces errors and the corresponding log file are located at the URLs:

http://www.doanalytics.net/Documents/OPTEX_Plantilla_Modelo_VRP-v01.xlsx

http://www.doanalytics.net/Documents/INPUT_CHECK_DSS_1.LOG

7. CHECK THE MMIS

Below, it is the process to be followed once all the tables that are part of the MMIS; this process is

oriented to present the services provided by OPTEX to facilitate implementation, correction and the

startup of the system of mathematical models. This will be followed as a guide errors reported in the massive process, corrections will be made in the EXCEL template.

The template and the log file resulting from the review process are at the URLs:

http://www.doanalytics.net/Documents/OPTEX_Plantilla_Modelo_VRP-v03.xlsx

http://www.doanalytics.net/Documents/INPUT_CHECK_DSS_3.LOG

7.1. INDEXES

The following image presents the information load and the reported errors, which are related to the existence of commas in the DLES_IND field. The solution may be to change the delimiter or to

remove commas from the long descriptions.

Page 53: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

52

7.2. SETS

The following image shows the load of sets and the reported errors, which are related to the existence

of commas in the DLES_CON field. The solution may be to change the delimiter, or remove commas from the long descriptions.

Page 54: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

53

Given that the error occurs on the TRC set which is indexed by two indexes (k,v) and representation of this includes the separating comma, the required solution is to change the delimiter of comma (,)

by semicolon (;) or another appropriate delimiter.

At this point, it is convenient to reimport the database of mathematical models using the semicolon

(;) as a delimiter. This means repeats the process from the generation of CSV files. The following image shows the result of the process which no longer presents data from the EXCEL template

import errors. The new report of the process is located in.

http://www.doanalytics.net/Documents/INPUT_CHECK_DSS_2.LOG

The next step is to review the sets which can be done through the special services offered by OPTEX which is accessed through the right-click of the mouse, as shown in the following image.

When you run CHECK ALL SETS (Chequear Todos los Conjuntos), OPTEX will generate a report

which indicates the existing errors related to the table CONJUNTO (SET).

Page 55: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

54

Reported errors are due to that when the set is non-indexed (does not depend on any index) the

corresponding field (COD_IND) should be filled with an asterisk (*). The image displayed in the

EXCEL template sets with errors.

OPTEX stored in tables the errors found, so that the user can access from the associated container

window. Errors are stored in tables called ERR_xxx where it is associated with the code of the mathematical entity, in this case the table used is ERR_CON which it is accessed from the File menu

option OPEN TABLE RELATED (Abrir Tabla Relacionada, first button on the left of the toolbar),

this at all master tables related to the mathematical elements.

Page 56: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

55

7.3. PARAMETERS

The image below presents reported errors in the load of the parameters which are related to the parameters CVIA, DEMP and DEMB

Then, it will be revised the errors presented for each parameter which are all due to that parameter

indexes were not included in the table PAR_IND that contains the relationship between parameters

and indexes.

Page 57: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

56

1. PARAMETER: CVIA

CVIAv,c,k =COVAv × DISTc,k

2. PARAMETER: DEMP

DEMPc = bCAC(c) NUCDc,b × PECAb

In addition, the NUCD parameter is not listed, since it was forgotten in the original formulation. It must be included the NUCD parameter in the modeling system.

3. PARAMETER: DEMP

DEMPc = bCAC(c) NUCDc,b × PECAb

In addition, the NUCD parameter is not listed, since it was forgotten in the original formulation.

The correction related to the NUCD parameter is presented below

CALCULATED PARAMETERS

PARAMETER DESCRIPTION UNIT

NUCDc,b Boxes for customer c Total of boxes (b) must be delivered to the client c

NUCDc,b = wPEC(c) NUCAw,b Parameters: NUCAw,b Number of boxes b in the order w (und)

und

The table of parameters including the new parameter is presented below.

BASIC PARAMETERS

PARAMETER DESCRIPTION UNIT TABLE FIELD

CAPPv Capacity of the vehicle weight Vehicle weight capacity measured in kilograms

kg VEHICULOS CAPP

CAPVv Capacity of the vehicle in volume Volumetric capacity of the vehicle, measured in cubic metres

m3 VEHICULOS CAPV

COVAv Variable costs using a vehicle Cost per kilometer by using the vehicle

$/kmt VEHICULOS COVA

Page 58: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

57

BASIC PARAMETERS

PARAMETER DESCRIPTION UNIT TABLE FIELD

CAPPv Capacity of the vehicle weight Vehicle weight capacity measured in kilograms

kg VEHICULOS CAPP

CAPVv Capacity of the vehicle in volume Volumetric capacity of the vehicle, measured in cubic metres

m3 VEHICULOS CAPV

CFIJv Fixed cost for using vehicle v Fixed cost of use the vehicle v

$/día VEHICULOS CUVE

DISTc,k Distance nodes Distance between the origin node and the destination node

km NOD_NOD DIST

NUCAw,b Number of boxes of the order Number of cases order that must be transported to the node

und PED_CAJ NUCA

PECAb Weight box Weight of boxes in kg

kg CAJAS PECA

VOCAb Volume of boxes Volume of the boxes in cubic meters

m3 CAJAS VOCA

CALCULATED PARAMETERS

PARAMETER DESCRIPTION UNIT FORMULA

CVIAv,c,k Cost of travel between nodes Cost of travel of the vehicle from source node to the destination node

$ CVIAv,c,k =

COVAv × DISTc,k

DEMPc Demand in weight The node demand expressed in kilograms

kg DEMPc = bCAC(c)

NUCDc,b × PECAb

DEMVc Demand in volume Demand for the node, expressed as a volume

m3 DEMVc = bCAC(c)

NUCDc,b × VOCAb

NUCDc,b Boxes total for customer c Total of boxes (b) must be delivered at the client c

und NUCDc,b =

wPEC(c) NUCAw,b

The following images show the corrections made in the EXCEL template.

Page 59: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

58

7.4. VARIABLES

The following image shows errors reported in the load of the variables. These errors are generated by the error of not having defined for non-indexed sets the asterisk (*) to indicate this fact.

To correct the error in the sets definition, disappears the error in the variables, as you can see in the

following image.

7.5. VARIABLES ALIAS

The following image shows errors reported in the variable alias load. These errors are generated by the error of not having defined for non-indexed sets the asterisk (*) as the independent index; in

addition, the variable alias is associated with a non-existent variable VCK.

Page 60: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

59

The error can be corrected directly at OPTEX-GUI interface, as shown below.

Then, the correction in the EXCEL template.

7.6. CONSTRAINTS

First error reported by OPTEX is related to the inclusion of an empty record, total or partially, in

the table of constraints.

This can occur in any table, and is generated when the export macro included in the CSV file invalid records due to the existence of some element of "garbage", that falsely indicates the existence of

information in the row, or column; this generates bugs are resolved eliminating the empty record.

Page 61: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

60

To review the constraints, first it is convenient to resolve errors in the sets, parameters, and variables, this can be done directly in the OPTEX-GUI interface or through the reprocessing of the EXCEL

template. Once it has made this correction, the following image presents the bugs reported in the load of the following equations: CAPP, CAPV and UTVE.

Then will review the errors presented for each constraint.

Page 62: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

61

1. CONSTRAINT: CAPPv

cNCV(v) kTRK(c v) DEMPc × VCLv,c,k

≤ CAPPv

vVEH

The reported error indicates that the index v is duplicated. The solution is to eliminate duplication and review leaving as the only mistake the fact that dependent index v of the VEC set not coincides with the index c over which the sum is defined, the right set is the NCV.

2. CONSTRAINT: CAPVv

cNCV(v) kTRK(c v) DEMPc × VCLv,c,k

≤ CAPPv

vVEH

The reported error indicates that the index v has not been declared, should be included and correct the error of the VEC set similar to the previous case.

3. CONSTRAINT: UTVEv

cNCV(v) kTRK(c,v) VCLv,c,k - ∞ × AVLv ≤ 0 vVEH

The reported error is related to the INFI ("infinite") parameter, which has not been declared. The solution is to declare the parameter INFI, as a constant K, whose value is defined as "default".

The following images show the corrections made in the EXCEL template.

Page 63: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

62

7.7. OBJECTIVE FUNCTIONS

Bellow the errors reported by OPTEX for objective functions.

The first reported error is due to the blank line which is imported from the CSV file and the second to an error in the name/code of the VCL variable that was loaded as VLC

Page 64: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

63

Bellow the EXCEL template corrected

7.8. PROBLEMS

Related problems are associated with the inclusion of NOCL restriction that it is not considered in the formulation of the model. The solution is this case will be removed NOCL from the formulation.

The table that defines the problem remains as shown below.

VRP TYPE PROBLEMS

CODE DESCRIPTION PROBLEM

FORMAT

CONSTRAINTS

BASICS WEIGTH VOLUME

VRP Routing vehicle (VRP) MIP ENSA UTVE VCLI SANO

VRP2C Routing vehicle (VRP) - Weigth + Volume MIP CAPP CAPV

Page 65: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

64

The following image shows corrections in the EXCEL template.

7.9. MODELS

The models uploaded to the MMIS are below, it does not have errors.

Page 66: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

65

7.10. DECISION SUPPORT SYSTEMS

Finally, a system of decision-support containing the two formulated models can comply. So it can be

loaded into the EXCEL template in the DSS and DSS_MOD sheets.

The following image shows the structure of the DSS

7.11. SERVICES OFFERED BY OPTEX-GUI.

OPTEX-GUI provides several services to support the mathematician modeler in the implementation

of the models; to access to these services the user must click the right bouton mouse in the window of exploration of the mathematical models area. These services are presented in the following image

and correspond to the third group of services:

Page 67: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

66

IMPORT MMIS

This service has already been presented and was used for massive loads of the MMIS from files in CSV format.

GENERATION ALGEBRAIC FORMULATION IN RTF DOCUMENT

Generates a RTF document with all the algebraic formulation. This document can be edited with text

editors such as MS-Word programs and other similar. The generated document can be downloaded

from the URL: http://www.doanalytics.net/Documents/INPUT_CHECK_DSS_2.LOG

CHECK MMIS STRUCTURE

This service has been used in the process of massive load of the MMIS which includes the check of

the structure, the report is similar to those previously presented.

EXPORT OF THE MMIS TO EXCEL FILES

This service is in the process of adjustment.

EXPLORATION OF THE MMIS

It allows to directly explore all tables that comprise the MMIS and modify its content if deemed

suitable, such as shown in the following image.

Page 68: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

67

8. OPTEX-GUI: IMPLEMENTATION AND VALIDATION OF THE IDIS

The implementation of the IDIS requires several steps for the correct operation of OPTEX-GUI,

the steps are: Checking of the data model of the IDIS

Loading data to the template OPTEX_VRP.xls Generation of OPTEX-GUI structures

Import the data to the IDIS to be accessed by OPTEX-GUI Check the integrity of the IDIS, taking into account the rules established by the modeler

8.1. CHECKING THE DATA MODEL OF THE IDIS

Below, it is the process to review and validate the data model of the IDIS to continue once all tables that are part of the MMIS has been loaded. This process is aimed to introduce the services provided

by OPTEX to facilitate implementation, correction and set up of industrial data information system.

This will be followed as a guide the generated reports to access tables that contain the data model structure: CAMRE, CDBAS and DDBAS.

The first step is to proceed to create the tables that are defined in the MMIS, so must access to the

table that contains Data Tables and to active with the click on the right bouton mouse of the service of creation of tables, as shown in the following image.

The result of the process is the creation of tables and reports CREAR_DB.LOG and

ERROR_CREAR_DB. LOG that contains, if any, the found errors; such as the following image presents it.

Page 69: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

68

In this case, it was found inconsistencies in the length of the relational fields (keys) defined in the

table CAMRE with the existing tables fields, the errors are presented for the COD_VEH and

COD_PED fields. To find the errors you can access the CAMRE table and from there locate the inconsistencies; to do this access option RELATED TABLES (Tablas Relacionadas), as shown in

the following image.

As you can see, the inconsistency is generated in the CAMRE table that has reversed lengths to COD_PED and COD_VEH. The correct OPTEX-EXCEL template is presented below.

Page 70: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

69

In addition, three tables included in the definition of tables that are not part of the problem should

be eliminated: DIAS, ESC_DIA and HORARIOS. Below, the EXCEL template already is correct. It

should be noted that although the initial location of the tables is the permanent data area (I) since this facilitates the revision of the data contained in the IDIS, later, when you go to make runs of

models, it must relocate the tables in accordance with scenarios for the runs of the mathematical models.

8.2. GENERATION OF TEMPLATES EXCEL

OPTEX provides services to generate the EXCEL templates that are required to load industrial data.

This service can be performed from the table of data tables, accessing the CREATE TABLE BOOK EXCEL XML option which will be the base to load data from the IDIS with the right click of the

mouse.

Page 71: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

70

The template generated by OPTEX is stored in the permanent industrial data area of IDIS, the name

given to the template is OPTEX_aaa, where aaa is the name given to the application. The template

can be downloaded from the URLs: http://www.doanalytics.net/Documents/OPTEX_VRP.xls.

http://www.doanalytics.net/Documents/OPTEX_VRP.xml .

The template is generated in XML format and so that it is accepted by EXCEL should be considered when you try to open it EXCEL submit the following message, to which you must respond Yes. If

the extension of the book is changed to .xml prevents this message.

Then EXCEL will present the following window, the user must select setting of the book (Configuración del libro) and then Accept.

Page 72: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

71

Finally, the user will enter the book with all the tables in the information system to load data from the IDIS. It is recommended to the user to change format to conventional EXCEL and then use

OPTEX macros to export to CSV. The template includes second-row description of fields and their units, this information is taken from CDBAS and DDBAS tables from template in EXCEL.

8.3. GENERATING OPTEX_GUI STRUCTURES

This process enables the generation of a GUI interface that enables the modeler and the functional

user to navigate and to explore industrial data information system (IDIS). This allows to a mathematical modeler, non-expert in SQL statements, generate a user interface, fast, with basic

support for maintenance and queries of the IDIS. To carry out the process you must access the

service GENERATION STRUCTURES OPTEX-GUI with the right click of the mouse in the menus of OPTEX-GUI Explorer window.

Page 73: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

72

Through this process, OPTEX load the necessary information to set up a first version of the GUI

(Graphic User Interface) which is based on:

Exploration of the area of IDIS menus Generation of keys of ordering (indexes) to relate/link the tables of the IDIS

Configuration of the container window (shell windows) to facilitate access to tables Configuration data window to control the information presented in each data window.

In this way, OPTEX eliminates all the programming work that involves developing an interface for

the functional user; however, if the modeler wishes to create windows specialized to functional user,

this is already possible because OPTEX has other alternatives for this purpose.

8.4. THE IDIS DATA LOADING

Loading data from the IDIS involves three steps:

Loading data to the template OPTEX_VRP.xls Import the data to the IDIS to be accessed by OPTEX-GUI

Check the integrity of the IDIS, taking into account the rules established by the Modeler

The last two steps will be presented, the first part of the work and the creativity of the user. The

template loaded for this tutorial is linked to the URL: http://www.doanalytics.net/Documents/OPTEX_Plantilla_Data_VRP_1.xlsx

Page 74: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

73

From the EXCEL template should be to create the CSV file that will read OPTEX to load the database from the IDIS.

To perform massive, you must access to Import Tables IDIS (Importar Tablas SIDI) service.

Page 75: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

74

Como resultado del proceso OPTEX generará el reporte INPUT_CHECK_DATA.LOG.

In the previous report, it is important to note that for the tables NODOS and VEH_NOD have errors,

which will be reflected in reported errors in the validation of the data. Therefore, the appropriate it is to correct these errors before proceeding to the checking of the quality of the IDIS. Below, it is

the problem and the solution

Page 76: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

75

Below, errors and its solution are analyzed.

1. TABLE: NODOS The problem lies in the fact that the key associated with the index k is linked to the COD_NOD1 field which should be part of the master node table, and it is not. As the relational key COD_NOD1 is declared in the table CAMRE. Solution include COD_NOD1 in the table.

Additionally, the table node has largest number of fields to be defined: COTA, COTE, TSER, COOR_X, and COOR_Y. In this case OPTEX reports error reported. Solution include the fields in the table definition or delete the data in the table, the latter was implemented.

2. TABLA: VEH_NOD

The OPTEX report indicates that the COD_NOD1 field is not included in the table VEH_NOD. Solution include such a field that is required to manage the index k.

Based on the new templates should be to reimport the data and the models; alternatively, the errors

can be corrected directly at OPTEX-GUI.

The new templates are located at the URLs:

http://www.doanalytics.net/Documents/OPTEX_Plantilla_Data_VRP_2.xlsx http://www.doanalytics.net/Documents/OPTEX_Plantilla_Modelo_VRP_5.xlsx

8.5. CHECKING THE QUALITY OF DATA OF THE IDIS

The validation of the data that you enter in the mathematical models is a fundamental step which

helps raise the level of reliability/quality of the data, thus avoiding possible errors in the execution of

the mathematical models. One should distinguish two types of errors: Integrity: related to the relations between the different entities/objects that are part of

database and mathematical models, stablishing via relational keys/codes/fields of different tables and

Veracity: related to the contents of the fields that are part of tables.

Page 77: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

76

OPTEX provides services to validate the previous types of error. However, it is impossible to have an automated process to ensure one hundred percent (100%) the non-existence of errors in

accuracy. A simple example of a data error can be the capability in volume in a vehicle that is 10 tons

and the user enters the system 9; If the entered data meets the range of validity, it is impossible to detect the previous error of veracity.

Do not detect errors in the data translates into longer time implementation of models, since errors

can lead to problems in the solution of mathematical models that may be associated with different causes, for example problems of feasibility, or leak in the mathematical models (uncontrolled

productions), which can be difficult/impossible for manual verification processes to detect. This

problem is increased in that mathematical models are related to problems of large dimensions.

OPTEX has validation in three points of the process, in: Loading data to the tables;

The composition of sets; and

The values of the parameters.

The first control is carried out at the time of loading data in the database, the last two during the execution of the models.

8.5.1. RULES OF VALIDATION IN THE DATA MODEL

To configure data validation processes must access the table of settings of the fields from the tables of data (DDBAS), which is done accessing the container windows Data Tables and Fields of Data

Bases, OPTEX-GUI, in the OPTEX-EXCEL template on the DDBAS sheet.

The fields of a data table attributes include the Type of Validation (TV), which is used to guarantee the integrity of the data. The different types of validation parameters are assigned to the auxiliary

fields Parameter 1 and Parameter 2.

Page 78: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

77

Multiple Types of Validation are implemented in OPTEX-GUI and all of them are intended to

ensure the integrity of the relationships between the entities that are part of the information system. The template uses two types of validation A and D:

A Referential integrity. Validation by the contents of a field in a table. Used in the fields of secondary tables. It is usually the way to validate the existence of the content of a relational

code in the keys/codes included in the master table. It allows duplicity and empty fields. D Validation by duplication of the contents of the field in the table.

In general terms, the above rules are necessary, but there may be other additional rules to be included to ensure the solution to a mathematical model. The Manual of the Validation Data

Manager examines the issue of validation of data carefully.

8.5.2. CHECKING DATA INTEGRITY

To validate data quality OPTEX has Check Integrity IDIS service, which can be accessed from

OPTEX explorer via the right click of the mouse.

Page 79: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

78

As a result, the DATA_VALIDATION.LOG report is obtained, it contains all errors reported by

OPTEX taking into account validation rules implemented by the Modeler.

In addition to the report, OPTEX generates tables with the errors that the modeler can review from OPTEX-GUI accessing to the window associated with the Data Tables.

Page 80: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

79

Errors of integrity found in the different tables are then analyzed. So it is suggested to review the menu of Data Model window associated with Database Errors in which there are tables with errors

and the records within each table.

Al analizar las bases de datos de errores se encuentran el reporte de tres tablas: CAJAS, ESC_PED

y VEHICULOS. A continuación, se analiza la razón de los errores.

Analyzing the errors databases are the report of three tables: CAJAS, ESC_PED and VEHICLES.

The reason for the errors is then analyzed.

1. TABLE: CAJAS The problem lies in the fact that the description of the boxes (DES_CAJ), created by the "laziness" of filling the field. In this case, the field of boxes can be filled with the code of the box.

Page 81: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

80

2. TABLE: ESC_PED The problem lies in the fact that the the order code is not defined in the master ORDERS table. If we review the ORDERS table that field is empty, therefore the solution to load the table correctly.

In addition, it is also an error that the PED_CAJ table is empty. This table must be created.

3. TABLE: VEHICULOS The problem is that some descriptions of vehicles (DES_VEH) are repeated, creating confusion since a description must be different for each code. The solution will be concatenated codes with descriptions to generate a new description does not repeat.

To avoid mistakes such as those presented and improve the quality of the data, some validation rules, will be adjusted including rule F:

F Referential integrity, not to allow empty fields and requires the existence of all the codes/keys

for the master table in the field in the table being validated.

This rule applies to the following couples table-field: PEDIDOS - COD_CLI: implies that they may not exist orders without a client (node) assigned

and that there must be at least one order for each customer. PED_CAJ - COD_PED: implies that there has to be at least one box type assigned to each

order.

PED_CAJ - COD_CAJ: implies that there has to be at least one order assigned to the type of box.

NOR_VEH - COD_VEH: implies that for any vehicle there must be a warehouse assigned. NOD_NOD - COD_NOD: implies that for any vehicle there is at least one node destination to

which it can go

NOD_NOD - COD_NOD1: implies that for all node there is at least one origin node which can be arrived from.

VEH_NOD - COD_VEH: implies that for all node there is at least one node which can go to. VEH_NOD - COD_NOD: implies that or all node there is at least one vehicle that can visit it

Corrections in the data tables may be held at OPTEX-GUI and are subsequently exported to a

template to keep the data in the EXCEL template. The PEDIDOS.csv and PED_CAJ.csv tables

Page 82: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

81

were obtained from other sources and it was imported into the IDIS through import of text files. The tables used are available from the following URLs:

http://www.doanalytics.net/Documents/PEDIDOS.csv.xlsx

http://www.doanalytics.net/Documents/PED_CAJ.csv.xlsx

The new template, including new validations are located at the following URL: http://www.doanalytics.net/Documents/OPTEX_Plantilla_Modelo_VRP_6.xlsx

The next step is to conduct a new analysis of integrity, with new tables and new validations, resulting

in the report DATA_VALIDATION_1.LOG which is located at the URL:

http://www.doanalytics.net/Documents/DATA_VALIDATION_1.LOG

This report presents problems of integrity for the following tables: NOR_VEH, PED_CAJ, ORDERS

and VEH_NOD. Then, the problems encountered are:

1. TABLE: NOR_VEH The problem lies in the fact that there are codes of vehicles (COD_VEH) for which is not assigned origin warehouse. Solution remove reported vehicles of the master VEHICULOS or complete the table NOR_VEH. Solution remove the masters existing codes.

The image shows invalid records in the NOR_VEH table. There is no one.

Page 83: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

82

2. TABLE: PED_CAJ The problem lies in the fact that there are boxes codes (COD_CAJ) and codes of the orders (COD_PED) that are not listed in their respective master tables. Also reports that there are orders for which there are no assigned boxes. Solution delete invalid records and perform integrity analysis.

The image shows invalid records in the table PED_CAJ, which will be deleted.

3. TABLE: PEDIDOS The problem lies in the fact that there are codes of clients/nodes (COD_NOD) that are not listed in their respective master tables. Also it is reported that there is a customer, 8300251421-0, for which there are no orders, which is correct since this node corresponds to the warehouse. Solution delete invalid records and perform integrity analysis.

The image shows invalid records in the ORDERS table, which will be deleted. 4. TABLE: VEH_NOD The problem lies in the fact that there are codes of vehicles (COD_VEH) for which is not assigned origin warehouse. Solution remove the reported vehicles of the master VEHICULOS table or complete the VEH_NOD table. These coincide with reported errors for the table. Solution delete from master table the existing codes.

The image shows invalid records in the VEH_NOD table. There is no one.

When settings are made there are still errors in the PED_CAJ table.

Page 84: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

83

5. TABLA: PED_CAJ The problem lies in the fact that codes of the orders (COD_PED) that are not listed in the master table, this is caused by the elimination of codes of orders in the ORDERS TABLE. Solution delete invalid records.

There are also orders for which there are no boxes in the table PED_CAJ. Solution delete invalid orders and return to the analysis of integrity.

The image shows invalid records in the table PED_CAJ, which will be deleted.

After these adjustments, are new inconsistencies. This shows that to have a database with quality data, is not a trivial task. In the following tutorial are not presented in detail processes made up to

have an integrity error-free database. Correction methodology is presented it so far.

Now that you have an error-free database you can proceed to make the model runs. It should be

noted that: A system with integrity errors can produce correct solutions

A system without integrity errors can produce incorrect solutions

The real gain is that when it has been verified the integrity of the information the modeler and functional user are aware of the quality of the data that are handling.

Once you have the correct data in the IDIS (tables in DBF format), it is possible to export it to an

EXCEL template or to CSV files; this can be performed from various points in OPTEX, the following picture is the access to the process from the table of Data Tables.

Page 85: IMPLEMENTATION OF THE VRP PROBLEM (VEHICLE ......DBT Memo Files: When tables contain MEMO fields, the managers of DBF databases linked a special table to store the MEMOs called XXXXX.DBT,

TUTORIAL:

IMPLEMENTATION OF THE VRP PROBLEM

84

The template generated by OPTEX is called OPTEX_Plantilla_Data_VRP_OK.xlsx and is linked to the URL:

http://www.doanalytics.net/Documents/OPTEX_Plantilla_Data_VRP_OK.xlsx