Computer Algorithm for comparing and ordering models based on indicators and user value

Sometimes a list of models can be compared using a set of indicators, ordered by the user’s criterion, given that it is known whether the growth of the indicators value affect the user’s interests. This paper proposes a computational algorithm that compares models, assigning them a numerical value that corresponds to the priority given to each model indicator by the user. The proposed algorithm allows to rank the models as other known algorithms do, such as the vector space model; however, it takes into account user comparison priorities. When working with lineal functions, the margin of error in the algorithm calculations is null. The algorithm is validated by the software Ambiens v1.0, whose purpose is to manage the waste control information, showing relevant results in the comparison of models. The algorithm essence is the need to identify the best model of the group, according to the user’s criterion per indicator.

En ocasiones se tiene un listado de modelos que se deben comparar mediante un grupo de indicadores, ordenados según el criterio de un usuario, y, dado que se conoce si el crecimiento del valor de los indicadores afectaría o no los intereses del usuario.Se muestra un algoritmo computacional capaz de comparar y asignar un valor numérico a cada modelo, de tal forma que el valor asignado se corresponda con la prioridad establecida por el usuario a cada indicador de los modelos.El algoritmo propuesto permite establecer un ranking entre los modelos, al igual que otros algoritmos conocidos, como el Modelo Espacio Vectorial; sin embargo, este algoritmo considera las prioridades de comparación del usuario.Al trabajar estrictamente con funciones lineales, el margen de errores de cálculo es nulo.El algoritmo ha sido validado por el software Ambiens v1.0 (dedicado a la gestión de residuos) Computer Algorithm for comparing and ordering models based on indicators and user value y muestra resultados relevantes en la comparación de modelos.La propuesta cobra su esencia en la necesidad de conocer, de entre un grupo de modelos, el mejor de ellos, según el criterio de usuario por indicadores.

I. IntroductIon
The increase of production costs in the industry, due to the loss of unused raw material has led to the concern of experts who study waste generation from industrial processes.Such concern is sustained by the law of conservation of mass discovered by Lavoisier, which states that the total mass of reacting substances is equal to the mass of products formed in the reaction [1]; from this, it is derived that the mass of the matter before the reaction is equal to that of the matter after the reaction.The matter after the reaction will be composed of the final product and wastes.This confirms that minimizing the waste generation increase the production; therefore, Reverse Logistics (RL) appears in order to achieve such minimization.
In essence, RL deals with the recovery and recycling of containers, packaging of dangerous wastes, and also with the processes of return of inventory excess, customer returns, obsolete products, and season inventory [2].Several studies have been conducted in this field, such as [3] that proposed a genetic algorithm to solve the problem of decisions related to the location of treatment plants, collecting and transfer places; [4], which proposed an evolutionary algorithm to solve the NP-hard problem of a remanufacturing net; and [5], which solved the problem of programming ground international transportation with a metaheuristic algorithm.Other studies, focused on mathematical models such as Schrady's (considered the father of the RL models), can be found in the literature; examples of them are [6], which optimized the requests to the repairable item warehouse and to the main supplier; [7], which proposed a model to optimize production and refabrication, and [8], whose model analyzed the optimal expression that the return of items must have.
The problem is that the models do not reflect comparison criteria with other similar models.Even if there were any criterion of comparison, an importance user value for a given model over the rest of the models is not calculated.For a better understanding of these issues, this paper shows an example based on the model published by [9], given that this paper revolutionized the RL.This deterministic model allows to find optimal lots of requests to the external supplier and the process of recovery [10].The reason is that when there are N suppliers requiring different conditions, N different models arise.Then, the use of comparison indicators becomes necessary, so that according to a given order of priority, it is possible to determine the proper model based on any criterion of user value (UV) assignment.
In this paper, results and discussion describe algorithms for comparing models, based either on criteria or on numerical methods of high codification complexity.The main result of this paper is a computational algorithm that easily solves the problem of comparison among models through UV assignment by positioning, taking into account that the UV assigned to each model corresponds to the priority set by the user for each indicator.
Therefore, the advantage of the algorithm is that, given a set of N indicators with an established priority and a set of M models , where a list of N values corresponds to each , it allows to order the models according to the priority set by the indicators, and at the same time, to calculate a UV for each model that corresponds to the given priority.For that reason, the algorithm is named "Comparison for ordering models based on indicators and UV (COMIUV)."

II. MaterIals and Methods
In order to simplify the understanding of the algorithm, we analyzed the Schrady's model, published in [9], as a case study, for which some indicators with different values for each model have been defined.Furthermore, we simulated and visualized the proposed computational algorithm, and provided the generalized version of the algorithm.

A. Schrady's model, a case study
It is important to highlight that this model does not belong to the area of informatics, but it is reflected in an industrial engineering problem.Therefore, in order to understand the essence of the model and the relation among the indicators proposed herein [9].

Suppose we have indicators by which Schrady's models (
) must be compared, and that those indicators have been ordered by an user from greater to smaller priority, resulting in the form . Also, it is known that are good for the user, which means that the greater their value, the greater the Computer Algorithm for comparing and ordering models based on indicators and user value benefit for the user, and that are bad for the user, that is, the greater their value, the smaller the benefit for the user.As an example, Table 1 shows the distribution of the indicators values for each model.Step 0: Table 1 must be adjusted according to the priority given by the user (Table 2).Step 2: To move the VMI, six orderings are performed, one for each row of the VMI, so that each row is ordered from greater to smaller, according to the C value of each vector placed in the entry (i corresponds to the row, and j to the column, where the first row or column has a value equal to 0).Any ordering algorithm that best suits can be used (Table 4).After step 2, we are in conditions to define the proper order of the models.Selecting according to the first row is enough, and in case of a tie, the decision will be based on the next row.In this case, the order can be observed (Table 4).The problem is that perhaps the intentions do not lead to a simple ordering, but to an assignation of a value to each model, which corresponds to the previous ordering from greater to smaller.At the same time, this value must integrate the positioning of each vector with a value, whose meaning will be named as user value (UV), which must substitute the C value of the vector, so that the total UV (sum of each UV of the vectors corresponding with the model) comply with the desired ordering.In order to achieve the UV assignment in C for each vector, it is necessary, even in the worst circumstances of comparison, to have a proper ordering, that is, the winning model in the worst way (it wins because its indicator of greater priority is the best among all the models, but the rest of its indicators are the worst) is better than the second best model (its indicator of greater priority is the second among all the models, but the rest of its indicators win among all the models); and it is required that equation (1) holds for any entry according to Table 5.

table 5 an EXamPLE of thE SumS to bE ComParEd by SimiLitudE of CoLor
Note that the used logic for this methodology of assigning value to the C component is sustained by a logic ruled provided by the method of "proof by contradiction" or by "strong reduction to an absurdity".If the questioning of a determinable statement is followed by the acceptance and questioning of a statement incompatible with its denial, then the initial statement is accepted [11].If it is possible to assign an UV in C of each vector, such that even in the worst circumstances the model with the indicator of greater priority with greater value still remains the winner, in any other circumstance where the conditions of this indicator of greater priority prevail and the conditions of values in the rest of the indicators become better, the model having this indicator with a greater value will always win.
Step 3: Conversion of the VMI into a matrix of user value (MUV) (Table 6).This step consists in moving along all the entries of the VMI and replacing the C component of each vector with a value that holds the previous condition.In order to achieve this, it is proposed that the C value for each vector, placed in the position be modified according to the following rules (where N is the number of indicators and M the number of models): Step 4: Finding the UV of each model.After assigning an UV in C for each vector, the total UV corresponding to each model can be calculated as the sum of the C value of the vectors corresponding to each model.The final result of the algorithm is shown in Table 7 and Fig. 1.

Generalized version
In this section, a generalized version of the COMIUV algorithm, proposed here, is detailed, implemented, and tested in the software Ambiens v1.0 for waste management.RL and the selection of the proper model are implemented in this software, according to the priorities given by the user to the indicators for model comparison, where one of them is the Schrady's model visualized in the previous example.It is worthy of remark that this generalized version applies to any case of applied models.

Situation:
We want to compare M models, taking into account the priority order given by the user to N indicators.At the end, the user value must be set for each model, where the greater UV, the better the model.

Entry:
The algorithm entry is a matrix of N rows and M+2 columns, where each entry relates the M model to the N values of its indicators.The information about whether the increase of the indicator is good for the user is found in the next to the last column, and the priority of each indicator (row), in the last column.
Step 0: First, the matrix must be adjusted according to the priority given by the user (i.e., ordering the rows from smaller to greater by the priority number, where the smaller the number, the greater the priority), and the last column must be deleted, so that the matrix remains with a dimension of only with the data necessary for the next steps.
Adriel Alejandro Aliaga-Benavides -Yudisel Santana-Pacheco -Antonio Mustelier-Hechavarría -Yuniel Guzmán-Bazán Step 1: Conversion of the matrix of indicators into a vector matrix, where each indicator value per model becomes a vector of two components: B and C (B is the identifier of the model, and C is the indicator value for model B; if the indicator is bad for the user, C is assigned ).The vectors would remain as: Step 2: To move the MVI, N orderings will be performed, one for each row of the MVI, so that each row is ordered from greater to smaller, according to the C value of each vector placed in the entries .
Step 3: Converting the MVI into a matrix of user value (MUV) consists in moving along all the entries of the VMI and replacing the C component of each vector with a value that holds condition (1).In order to achieve this, it is proposed to modify the C value for each vector placed in the position according to the following rules (where N is the number of indicators, and M the number of models): .
Step 4: Finding the UV of each model as the sum of the C values of the vectors corresponding to each model.The final result of the algorithm would be an ordered relation, from greater to smaller, among models and their corresponding UV expressed as follows:

III. results and dIscussIon
There are computational algorithms for comparing models such as Markov chain Monte Carlo (MCMC), which is a general set of techniques for simulated sampling that use distributions achieved through Markov chains, in order to generate independent samples based on the distribution of interest [12]; the Metropolis-Hastings algorithm is a general MCMC method for finding a conditional density an easily sampled distribution, and then, generating observations of the proposed distribution, in order to decide whether they correspond to the distribution of [13].Both algorithms depend on using complex numerical methods, which makes their implementation more complex than implementing COMIUV.However, it would be fair to compare COMIUV with other algorithms with similar features, such as entry parameters and main objective.
It is obvious that COMIUV sets a ranking among models.Due to the entry features, models may be seen as objects that can be measured by a number N of indicators.The vector space model (VSM) is a wellknown method in the theory of information retrieval that seeks to rank documents, taking into account the weights of the terms found in each document [14].In this case, the similitude to give any ranking solution for this second algorithm lies in that M documents must be considered for evaluation, taking into account N indicators that set the weights of the terms.It is necessary to consider the models as vectors, whose components values are the weights of each indicator.With the values from table 1, the values in Table 8 can be considered as the entry for the VSM.MVS works with distances between the entry vectors and a desired vector in the search.The priority of the user in the indicators is not considered in the VSM's philosophy.In this sense, it is logical to consider that for the user, it would be optimal to compare with the best possible vector, which is the one with the greater weight achieved for each indicator in each component, named as "query" in the study case.Then, the definitive entry to take into account is: The resulted VSM ranking after entering these data is shown in Table 10.

Models
Value of ranking 0.9341 0.9323 0.9245 0.9210 0.8884 Comparing to Table 7, we observe a coincidence in the order of the models , in the case of COMIUV (Annex 1) were winners in the same order.However, the results corresponding to the rest of the models are different, probably due to the fact that VSM does not take into account the priority of the indicators, because only the ideal vector (query) is of interest to compare the vectors that represent the documents (in this case the models).Table 11 summarizes the comparison between both algorithms.

FIg. 1 .
FIg. 1. Relation model -Total UV shown to the user.

table 2
indicator value for model B; if the indicator is bad for the user, C is assigned ).The objective is to keep the reference of the values of the indicators for each model after ordering in step 2 (Table3).

table 8
Entry for vSmIf the entry is adjusted by the criterion "good", as in COMIUV, multiplying the weights of the indicators that are not good for the user by -1, we obtain the values shown in Table9.

table 11
ComPariSon bEtwEEn thE Comivu and vSm aLGorithmS