Stairs.  Entry group.  Materials.  Doors.  Locks.  Design

Stairs. Entry group. Materials. Doors. Locks. Design

» Application of the hierarchy analysis method in the assessment of urban land. Features of using the hierarchy analysis method, its advantages and disadvantages

Application of the hierarchy analysis method in the assessment of urban land. Features of using the hierarchy analysis method, its advantages and disadvantages

C then – maintenance costs, including wages of IS personnel;

With hp – costs associated with the use of global computer networks (Internet, etc.);

From neither - costs for storage media; From other - other costs.

Largest specific gravity in operating costs belongs wages, depreciation charges, maintenance.

Hierarchy analysis method (MAI)

The Hierarchy Analysis Method (HAM) is a mathematical tool for a systematic approach to complex decision-making problems. MAI does not prescribe any “correct” solution to the decision maker, but allows him to interactively find an option (alternative) that best fits his understanding of the essence of the problem and the requirements for its solution. This method was developed by American mathematician Thomas Saaty.

MAI allows you to clearly and rationally structure a complex decision-making problem in the form of a hierarchy, compare and perform quantitative assessment alternative options solutions.

Analysis of the decision-making problem in the MAI begins with the construction of a hierarchical structure, which includes the goal, criteria, alternatives and other considered factors influencing the choice. This structure reflects the decision maker's understanding of the problem. Each element of the hierarchy can represent different aspects of the problem being solved, and both tangible and intangible factors, measurable quantitative parameters and quality characteristics, objective data and subjective expert assessments.

The next stage of the analysis is to determine priorities representing the relative importance or preference of the elements of the constructed hierarchical structure, using a paired comparison procedure. Dimensionless priorities make it possible to reasonably compare dissimilar factors, which is distinctive feature MAI.

On final stage analysis, a synthesis (linear convolution) of priorities is performed on the hierarchy, as a result of which the priorities of alternative solutions relative to the main goal are calculated. The alternative with the maximum priority value is considered the best.

Procedure for using MAI:

1) Construction quality model problems in the form of a hierarchy, including a goal, alternative options for achieving the goal, and criteria for assessing the quality of alternatives (see Figure 3).

Hierarchical structure is a graphical representation of a problem in the form of an inverted tree, where each element, with the exception of the topmost one, depends on one or more elements located above it. Often in various organizations distribution of authority, leadership and effective communication between employees are organized in a hierarchical form.

Hierarchical structures are used to better understand complex reality: we decompose the problem under study into its component parts; then we break the resulting elements into their component parts, etc. At each step, it is important to focus on understanding the current element, temporarily abstracting from all other components. When conducting such an analysis, an understanding of the complexity and versatility of the subject under study comes.

When we solve a complex problem, we can use hierarchy as a tool to process and perceive large amounts of information. As we design this structure, we develop a more complete understanding of the problem.

Rice. 4. The simplest hierarchy of MAI

2) Determining the priorities of all elements of the hierarchy using the paired comparison method.

Hierarchical structures used in MAI are a tool for qualitative modeling complex problems. The top of the hierarchy is the main goal; lower level elements represent many options for achieving the goal (alternatives); elements at intermediate levels correspond to criteria or factors that link the goal to alternatives.

There are special terms to describe the hierarchical structure of the MAI. Each level consists of nodes. Elements emanating from a node are usually called its children (children). The elements from which a node originates are called parent elements. Groups of elements that have the same parent element are called comparison groups. Parent elements of Alternatives, usually coming from various groups comparisons are called covering Criteria. Using these terms to describe the diagram below, the four Criteria are the children of the Purpose; in turn, Goal is the parent element for any of the Criteria. Each Alternative is a child of each of the Criteria that includes it. In total, there are two comparison groups in the diagram: a group consisting of four Criteria and a group including three Alternatives. The view of any MAI hierarchy will be

depend not only on the objective nature of the problem under consideration, but also on the knowledge, judgments, value system, opinions, desires, etc. of the participants in the process. Published descriptions of AHP applications often include various schemes and explanations of the hierarchies presented. Consistent implementation of all steps of the MAI provides for the possibility of changing the structure of the hierarchy in order to include newly emerged, or previously not considered important, Criteria and Alternatives.

3) Synthesis of global priorities of alternatives by linear convolution of the priorities of elements in the hierarchy.

After constructing the hierarchy, process participants use the MAI to determine the priorities of all nodes of the structure. Information for prioritization is collected from all participants and processed mathematically.

Priorities are numbers that are associated with hierarchy nodes. They represent the relative weights of the elements in each group. Like probabilities, priorities are dimensionless quantities that can take values ​​from zero to one. The higher the priority value, the more significant the corresponding element is. The sum of the priorities of elements subordinate to one element above the underlying one hierarchy level, is equal to one. The priority of a target is 1.0 by definition. Let's consider a simple example explaining the methodology for calculating priorities (Fig. 5).

Rice. 5. The simplest hierarchical structure of the MAI with default priorities

The figure shows a hierarchy in which the priorities of all elements were not set by the decision maker. In this case, by default, the priorities of the elements are considered the same, that is, all four criteria are of equal importance from the point of view of the goal, and the priorities of all alternatives are equal for all criteria. In other words, the alternatives in this example are indistinguishable. Note that the sum of the priorities of elements of any level is equal to one. If there were two alternatives, then their priorities would be equal to 0.500; if there were 5 criteria, then the priority of each would be equal to 0.200. In that simple example the priorities of alternatives according to different criteria may not coincide, which usually happens in practice. Let us give an example in which the local priorities of alternatives according to different criteria do not coincide. The global priorities of alternatives relative to the goal are calculated by multiplying the local priority of each alternative by the priority of each criterion and summing over all criteria (Fig. 6).

Rice. 6. Hierarchical structure of the MAI containing global and local default priority values

If the priorities of the criteria change, then the values ​​of the global priorities of the alternatives will change, therefore, their order may change. The figure shows the solution to this problem with changed criteria priority values, with A3 becoming the most preferable alternative (Fig. 7).

Rice. 7. Hierarchical structure of the MAI containing global and local default priority values

4) Checking judgments for consistency.

5) Making a decision based on the results obtained.

Practical study of the hierarchy analysis method

    1. Theoretical information

The method for analyzing hierarchies, developed and published in 1970 by the American mathematician Saaty, belongs to the class criterial. It has become very widespread and currently continues to be actively used - see, for example, (the problem of drawing up an optimal production plan for oil refining), (the problem of real estate valuation).

At the first stage of applying the method, the problem is structured in the form hierarchy or networks. The hierarchy is built from the top (goals - from a management point of view), through intermediate levels (criteria on which subsequent levels depend) to the lowest level (which is usually a list of choices).

Hierarchy is considered full, if each element of a given level functions as a criterion for all elements of a lower level. Otherwise the hierarchy is incomplete. It is not difficult to understand the process of determining the weights in the case of an incomplete hierarchy, since the priorities of the corresponding element in relation to which the assessment is made are used, i.e. the hierarchy can be divided into subhierarchy, having the topmost element in common.

To explain the method of analyzing hierarchies, consider an example illustrating the hierarchical representation of a problem. Let us assume that we are faced with the task of selecting a car from a population whose members (car models) are denoted as A, B, C and D.

Having defined the general goal at the first (highest) level - “Car” - at the second level there are five factors or criteria that clarify the goal, and at the third (lower) level there are four candidate cars that must be assessed in relation to the criteria of the second level.

The following criteria are used to determine our choice:

    Interior and trunk capacity

    Efficiency (fuel consumption)

    Ride quality

  1. Price

The next step of the method, after completing the step of hierarchical or network reproduction of the problem, is to prioritize the criteria and evaluate each alternative according to the criteria. In the hierarchy analysis method, task elements are compared in pairs with respect to their impact (“weight” or “intensity”) on a characteristic common to them. Let us carry out pairwise comparisons leading to a matrix form. Comparing the set of problem components with each other, we obtain the following square matrix:

It is obvious that this matrix has inverse symmetry properties, i.e.

where the indices i and j refer to the row and column, respectively.

Let A 1 , A 2 , A h , ..., A n- many of n elements and w 1 ,w 2 w 3 , ..., w n- according to their weight or intensity. Using the hierarchy analysis method, the weight, or intensity, of each element is compared with the weight, or intensity, of every other element in the set with respect to the property or purpose they share. Comparison of weights can be represented by a square table in which the numbers can be arranged as follows

If w 1 ,w 2 ,w 3 ...,w n are unknown in advance, then pairwise comparisons of elements are made using subjective judgments, assessed numerically on a certain scale, and after which the problem of finding the components is solved w.

To record the result of comparing a pair of alternatives, in particular, the scale proposed by the author of the method can be used:

1 - equivalence

3 - moderate superiority

5 - strong superiority

7 - very strong superiority

9 - highest (extreme) superiority

Values ​​2,4,6,8 are used to indicate an intermediate degree of superiority between the listed values.

If element i more important element j, then a positive integer (from 1 to 9) is entered into the cell; otherwise, the reciprocal number (fraction). The relative importance of any element compared to itself is 1; therefore the diagonal of the matrix (elements from the upper left to the lower right) contains only ones. Symmetrical cells are filled with inverse values, i.e. if element A is perceived as “slightly more important” (3 on the scale) relative to element B, then we consider that element B is “slightly less important” (1/3 on the scale) relative to element A .

When problems are presented hierarchically, a matrix is ​​constructed to compare the relative importance of criteria at the second level in relation to the overall goal at the first level. Similar matrices should be constructed for pairwise comparisons of each alternative at the third level in relation to the criteria of the second level. The matrix is ​​compiled by writing the goal (or criterion) being compared at the top and listing the compared elements on the left and top.

In the example, you will need to construct six such matrices.

One matrix is ​​created for the second level of the hierarchy, for example,

and five matrices - for the third level, for example,

Capacity:

Economical:

Ride quality:

Design:

Price:

The elements compared in pairs are possible options for choosing a car. It compares how much more desirable or good a particular car is for satisfying each second-level criterion. We obtain five matrices of judgments with a dimension of 4x4, since there are five criteria at the second level and four cars, which are compared in pairs for each of the criteria.

From a group of pairwise comparison matrices, a set of local priorities is formed, which express the relative influence of a set of elements on an element of the level adjacent to the top. We find the relative strength, magnitude, value, desirability or probability of each individual object through the “solution” of matrices, each of which has inversely symmetric properties. To do this, you need to calculate the set of eigenvectors for each matrix, and then normalize the result to one, thereby obtaining a priority vector. The calculation of eigenvectors is replaced by a simpler approximate calculation of the priorities of each criterion in the form of a geometric mean. To do this, the elements in each row are multiplied and the root is extracted from each product n th degree, where n- number of elements (alternatives). The resulting column of numbers is normalized by dividing each number by the sum of all numbers. Thus, it is possible to determine not only the priority order of each individual element, but also the magnitude of its priority. For our example we have:

For third level matrices:

Capacity:

Economical:

Ride quality:

Design:

Price:

Priorities are synthesized starting from the second level down. Local priorities are multiplied by the priority of the corresponding criterion at a higher level and summed for each element in accordance with the criteria affected by this element. This gives a composite, or global, priority of that element, which is then used to weigh the local priorities of elements compared to it as a criterion and located a level below. Thus, to calculate the weight of each option at the third level, it is necessary to find the sum of the products of the weight of each option for each criterion and the priority value of this criterion:

In the conditions of the example under consideration we have:

Very important is the so-called consistency index, which gives information about the degree of violation numerical(cardinal, ) and transitive(ordinal) consistency. To improve consistency, it is recommended to seek additional information and review the data used to construct the scale. In other procedures for constructing attitude scales, there is no structurally generated index. Instead of the ordinal scales traditionally used in constructing (using values ​​of 0,1,2 to express preferences), as noted above, in the pairwise comparison matrices of the method, reciprocal values ​​are used.

The consistency index in each matrix and for the entire hierarchy can be approximately obtained by manual calculations. First, the elements of each column of judgments are summed, then the sum of the first column is multiplied by the value of the first component of the normalized priority vector, the sum of the second column is multiplied by the second component, etc. Then the resulting numbers are summed. If we denote this amount as , then for the consistency index (CI) we have:

Where n- number of elements being compared.

Now let’s compare this value with the one that would be obtained by randomly selecting quantitative judgments from a scale of 1/9, 1/8, 1/7,..., 1.2, ...,9. Average consistencies for random matrices (CC - random consistency) have the following values:

We obtain the consistency ratio (CR) by dividing the IS by the number corresponding to the random consistency of a matrix of the same order.

For the first level matrix of this example we have:

IS=(5.29-5)/4=0.07

OS=0.07/1.12=0.066

For third level matrices:

An OS value of about 10% or less is considered acceptable. In some cases, 20% can be allowed, but no more. If the OS goes beyond these limits, then you need to re-examine the problem and check your judgments.

Hierarchy Analysis Method An example of a multicriteria selection problem with a simple hierarchy.

Hierarchy Analysis Method (HAI)- a mathematical tool for a systematic approach to complex decision-making problems. The MAI does not prescribe any “correct” decision to the decision maker (DM), but allows him to interactively find an option (alternative) that best matches his understanding of the essence of the problem and the requirements for its solution. This method was developed by the American mathematician Thomas Saaty, who wrote books about it, developed software products and has been conducting ISAHP symposia for 20 years. International Symposium on Analytic Hierarchy Process ). MAI is widely used in practice and is actively developed by scientists around the world. Along with mathematics, it is based on psychological aspects. MAI allows you to clearly and rationally structure a complex decision-making problem in the form of a hierarchy, compare and quantitatively evaluate alternative solution options. The Hierarchy Analysis method is used all over the world to make decisions in a variety of situations: from management at the interstate level to solving sectoral and private problems in business, industry, healthcare and education. For computer support of MAI there are software products developed various companies. Analysis of the decision-making problem in the MAI begins with the construction of a hierarchical structure, which includes the goal, criteria, alternatives and other considered factors influencing the choice. This structure reflects the decision maker's understanding of the problem. Each element of the hierarchy can represent different aspects of the problem being solved, and both material and intangible factors, measurable quantitative parameters and qualitative characteristics, objective data and subjective expert assessments can be taken into account. In other words, the analysis of the situation of choosing a decision in the MAI resembles the procedures and methods of argumentation that are used on an intuitive level. The next stage of the analysis is to determine priorities representing the relative importance or preference of the elements of the constructed hierarchical structure, using a paired comparison procedure. Dimensionless priorities allow for reasonable comparison of dissimilar factors, which is a distinctive feature of the AHP. At the final stage of the analysis, a synthesis (linear convolution) of priorities on the hierarchy is performed, as a result of which the priorities of alternative solutions relative to the main goal are calculated. The alternative with the maximum priority value is considered the best.

An example of a multicriteria selection problem with a simple hierarchy

In this task, you need to choose one of three candidates for the position of manager. Candidates are assessed based on the following criteria: age, experience, education and personal qualities. The figure shows the hierarchy for this task. The simplest hierarchy contains three levels: goal, criteria and alternatives. The numbers in the figure show the priorities of the elements of the hierarchy from the point of view of the goal, which are calculated in the MAI based on pairwise comparisons of the elements of each level relative to the elements of the higher level associated with them. The priorities of the alternatives relative to the goal (global priorities) are calculated at the final stage of the method by linear convolution of the local priorities of all elements. IN in this example the best candidate is Dick, since he has maximum value global priority.

Sphere of education and scientific research

Although for practical application MAI does not require special training; the basics of the method are taught in many educational institutions. In addition, this method is widely used in the field of quality management and is taught in many specialized programs such as Six Sigma, Lean Six Sigma, and QFD. About one hundred Chinese universities offer courses on the basics of MAI, and many degree seekers choose MAI as the subject of research and dissertation research. More than 900 scientific articles on this topic have been published. There is a Chinese scientific journal specializing in the field of MAI. Every two years, an International Symposium on Analytic Hierarchy Process (ISAHP) is held, which brings together both scientists and practitioners working with AHP. The 2007 symposium was held in Valparaiso, Chile, where more than 90 papers were presented by scientists from 19 countries, including the United States, Germany, Japan, Chile, Malaysia, and Nepal.

Device for remote input and processing of grades

Methodology for using MAI

The hierarchy analysis method contains a procedure for synthesizing priorities calculated on the basis of subjective judgments of experts. The number of judgments can be measured in dozens or even hundreds. Mathematical calculations for small problems can be performed manually or using a calculator, but it is much more convenient to use software for entering and processing judgments. The simplest method of computer support is spreadsheets; the most advanced software involves the use of special devices for entering judgments by participants in the collective choice process. The procedure for applying the Hierarchy Analysis Method:

Let's look at these steps in more detail.

Modeling a problem as a hierarchy

The first step of the MAI is the construction of a hierarchical structure that combines the purpose of choice, criteria, alternatives and other factors influencing the choice of solution. Building such a structure helps to analyze all aspects of the problem and delve deeper into the essence of the problem.

Definition of hierarchical structure

A hierarchical structure is a graphical representation of a problem in the form of an inverted tree, where each element except the top one depends on one or more elements above it. Often in various organizations, the distribution of authority, leadership and effective communication between employees is organized in a hierarchical form.

Hierarchical structures are used to better understand complex reality: we decompose the problem under study into its component parts; then we break the resulting elements into their component parts, etc. At each step, it is important to focus on understanding the current element, temporarily abstracting from all other components. When conducting such an analysis, an understanding of the complexity and versatility of the subject under study comes.

An example is the hierarchical structure that is used in teaching in medical schools. As part of the study of anatomy, the musculoskeletal system (which includes elements such as the arms and their components: muscles and bones), the cardiovascular system (and its multiple levels), nervous system(and its components and subsystems), etc. The level of detail reaches the cellular and molecular level. At the end of the study comes an understanding of the body system as a whole, as well as an awareness of the role each part plays in it. Through this hierarchical structure, students acquire a comprehensive knowledge of anatomy.

Likewise, when we are solving a complex problem, we can use hierarchy as a tool to process and perceive large amounts of information. As we design this structure, we develop a more complete understanding of the problem.

The simplest hierarchy of MAI. To avoid clutter in AHP diagrams, the links connecting Alternatives and their covering Criteria are often omitted or artificially reduced in number. Despite such simplifications in the diagram, in the hierarchy itself, each Alternative is associated with each of the Criteria that cover it.

Explanation of hierarchical structures used in AHP

The hierarchical structure used in AHP is a tool for qualitative modeling of complex problems. The top of the hierarchy is the main goal; lower level elements represent many options for achieving the goal (alternatives); elements at intermediate levels correspond to criteria or factors that link the goal to alternatives. There are special terms to describe the hierarchical structure of the MAI. Each level consists of nodes. Elements emanating from a node are usually called its children (children). The elements from which a node originates are called parent elements. Groups of elements that have the same parent element are called comparison groups. Parent elements of Alternatives, usually coming from different comparison groups, are called covering Criteria. Using these terms to describe the diagram below, the four Criteria are the children of the Purpose; in turn, Goal is the parent element for any of the Criteria. Each Alternative is a child of each of the Criteria that includes it. In total, there are two comparison groups in the diagram: a group consisting of four Criteria and a group including three Alternatives. The type of any MAI hierarchy will depend not only on the objective nature of the problem under consideration, but also on the knowledge, judgments, value system, opinions, desires, etc. of the participants in the process. Published descriptions of AHP applications often include various diagrams and explanations of the hierarchies presented. The sequential implementation of all steps of the MAI provides for the possibility of changing the structure of the hierarchy in order to include newly emerged, or previously not considered important, Criteria and Alternatives.

Prioritization

After constructing the hierarchy, process participants use the MAI to determine the priorities of all nodes of the structure. Information for prioritization is collected from all participants and processed mathematically. This section provides information that uses a simple example to explain the process of calculating priorities.

Prioritization and explanation

Priorities are numbers that are associated with hierarchy nodes. They represent the relative weights of the elements in each group. Like probabilities, priorities are dimensionless quantities that can take values ​​from zero to one. The higher the priority value, the more significant the corresponding element is. The sum of the priorities of elements subordinate to one element above the underlying hierarchy level is equal to one. The priority of a target is 1.0 by definition. Let's look at a simple example to explain the methodology for calculating priorities.

The simplest hierarchical structure of the MAI with default priorities.

The figure shows a hierarchy in which the priorities of all elements were not set by the decision maker. In this case, by default, the priorities of the elements are considered the same, that is, all four criteria are of equal importance from the point of view of the goal, and the priorities of all alternatives are equal for all criteria. In other words, the alternatives in this example are indistinguishable. Note that the sum of the priorities of elements of any level is equal to one. If there were two alternatives, then their priorities would be equal to 0.500; if there were 5 criteria, then the priority of each would be equal to 0.200. In this simple example, the priorities of alternatives according to different criteria may not coincide, which is usually the case in practice. Let us give an example in which the local priorities of alternatives according to different criteria do not coincide. The global priorities of alternatives relative to a goal are calculated by multiplying the local priority of each alternative by the priority of each criterion and summing over all criteria.

A more complex hierarchical structure containing global and local default priority values.

If the priorities of the criteria change, then the values ​​of the global priorities of the alternatives will change, therefore, their order may change. The figure shows the solution to this problem with changed criteria priority values, with A3 becoming the most preferable alternative.

The procedure for calculating importance indicators using the method of analyzing hierarchies by T. Saaty


Upon approval management decisions and predicting likely outcomes, the decision maker is typically faced with a complex arrangement of interdependent elements that must be sorted out. Today there are a lot of technologies that make life as easy as possible and help in solving problems that are integrated with decision-making processes. “Method for analyzing hierarchies, developed by T. Saaty. Today it is used everywhere: from realtors, when assessing real estate, to personnel officers, when filling vacant positions.” This method allows a group of people, interacting on a task that interests them, to modify their opinions and ultimately combine group opinions in accordance with the main criterion: when making pairwise comparisons of objects in relation to some characteristic, or characteristics in relation to a higher goal, polar relations provide the key to unification group judgments in an expedient manner.

T. Saaty's method of analyzing hierarchies is carried out according to the following scheme:

1) structuring the choice problem in the form of a hierarchy or network;

2) setting priorities of criteria and evaluating each of the alternatives according to the criteria;

3) importance coefficients are calculated for elements of each level. At the same time, the consistency of judgments is checked;

4) the combined weight coefficient is calculated and the best alternative is determined.

The key task in T. Saaty’s method of analyzing hierarchies is the assessment higher levels based on the interaction of different levels of the hierarchy, and not from direct dependence on the elements at these levels. Precise technologies for constructing systems in the form of hierarchies are gradually appearing in the natural and social sciences, and especially in problems general theory systems combined with the planning and construction of social systems. Conceptually, the most primitive hierarchy is linear, ascending from one level of elements to the next.

For example, in the production process there is a level of workers, subordinate to the level of foremen, which in turn is subordinate to the level of managers, etc., up to vice presidents and the president. In a nonlinear hierarchy, the top level can be in either a subordinate or a subordinate position. IN mathematical theory hierarchies, a technology is being developed to assess the influence of a level on an adjacent level by composing the appropriate contribution of lower-level components in relation to the upper-level component. This system can extend up the hierarchy.

In its most primitive form, the hierarchy is based from the top, through intermediate criteria to the lowest level - a set of alternatives.

After the hierarchical mapping of the question, criteria priorities are established and each of the alternatives is evaluated according to given parameters.

Each item can be assessed according to many quality indicators.

An expert can compare two objects and give them ratings, for example, ordering several objects by attractiveness. The expert's answers are usually measured on an ordinal scale, are rankings, and are the results of paired comparisons.

T. Saaty’s method of analyzing hierarchies involves the following stages:

2. building a hierarchy - decomposing the problem into elementary components: from the problem through intermediate components to the lowest - a list of simple ones.

The standard deviation can be chosen as a quantitative characteristic. IN in this case The authority of the approach is determined, by analogy with unequal measurements, by the value inversely proportional to the significance of the square of the standard deviation.

To conduct subjective pairwise comparisons, T. Saaty developed a relative importance scale.

Hierarchy Analysis Method - Effective, Elementary and available method. It was used to solve many problems, including:

Tutoring

Need help studying a topic?

Our specialists will advise or provide tutoring services on topics that interest you.
Submit your application indicating the topic right now to find out about the possibility of obtaining a consultation.

  • Graphic shells
    • Tutorial

    This is the 4th article in a series on model-driven development. In previous articles we got acquainted with, and. Today we will learn how to describe metamodels in text notation (and not in the form of diagrams as before) and get acquainted with the tabular representation of models in Sirius. Let's do this using the example of a midlife crisis and the method of analyzing hierarchies. You may find this useful when developing AI in games, decision making, or work.

    Introduction

    In general, I was planning an article about DSL development and model conversion. But my plans were suddenly disrupted by thoughts about the meaning of life, about whether I was even doing what I was doing.

    The most obvious thing a model-driven development specialist can do is:

    • Choose a method that will allow you to get the answers you are interested in (section 1)
    • Create a metamodel for this method (section 2)
    • Create a model development tool in accordance with the metamodel (section 3)
    • Create a Model (Section 4)
    • Profit
    This is exactly what we will do.

    1 Hierarchy analysis method

    I was interested in the following questions:
    • What am I interested in doing?
    • Am I spending enough time on interesting things?
    • What can you change in life for the better?
    • Will these changes make things worse?
    When I was at university, we used the hierarchy analysis method to get answers to various questions. The essence of the method is as follows.
    1. You define
      • target,
      • criteria for achieving the goal and
      • possible alternatives.
    2. Evaluate the significance of the criteria.
    3. Evaluate alternatives based on each criterion.
    4. Calculate the priorities of alternatives.
    5. You make a decision.
    This method is described in more detail in Thomas Saaty’s book “Decision Making. Method for analyzing hierarchies" (it's easy to Google). By the way, it contains many examples from psychology to global economics.
    1.1 Building a hierarchy
    So, in the simplest case, the hierarchy should contain a goal, criteria and alternatives.

    If I sum up all my questions, then, by and large, I am interested in whether I should change my job. Therefore the goal is: choose a job.

    When choosing a job I am interested in

    • How many money I will earn money
    • for how long Interesting I will do this
    • will I have time for life,
    • career prospects,
    • will I be able to attend nature or I will see the sun and trees once a year,
    • how close is it to me culture colleagues, neighbors and other people.
    The following alternatives are possible:
    • don't change anything
    • move to Moscow,
    • move abroad
    • start freelancing or some kind of entrepreneurship.
    In accordance with the hierarchy analysis method, the following hierarchy is constructed:
    1.2 Evaluation of criteria
    U different people When making decisions, there may be approximately the same criteria. However, their significance can vary greatly. Some people work more for money, some for fun, some just like to communicate with colleagues, etc.

    In accordance with their priorities, one person without hesitation will choose a more lucrative job, while another will choose a more interesting one. There is no job that suits absolutely everyone according to all criteria.

    Probably, when making decisions, most people explicitly or implicitly rank criteria from the most significant to the most insignificant. The latter are discarded, and possible alternatives are compared using the former. For each possible job they put a label on it: this job has more money, but is not interesting, while this one is interesting and has a good team, but dubious career prospects, etc.

    If you can’t make a choice right away, then the person begins to overestimate the criteria: maybe interest is not so important yet and you can stand in traffic for an extra two hours, but the salary is higher, so I’ll pay off the mortgage and do something interesting.

    Such reasoning can continue for a long time, painfully and without a guarantee that in the end the optimal decision will actually be made.

    The hierarchy analysis method proposes a formal algorithm for making such decisions: all criteria are compared in pairs with each other on a scale from 1 to 9.

    For example, what is more important to me: interest or money? Interest is more important, but not to say very much. If the maximum score is 9 to 1, then for myself I rate the priorities as 5 to 1.

    Or, for example, what is more important: money or having time for life, a hobby? Am I ready to work on weekends or stand in traffic jams for two hours for extra money? For myself, I rate the importance of these criteria as 1 to 7.

    As a result, a table like this is filled in:

    Obviously, there will always be ones along the diagonal. It is also obvious that all estimates will be inversely symmetric with respect to the main diagonal. For example, if I estimate the significance of “interest-money” as 5 to 1, then the significance of “money-interest” will be 1 to 5. Sometimes such matrices are called inversely symmetric.

    In general, if we compare N criteria, then we need to make (N*(N-1))/2 comparisons. It would seem that everything has only become more complicated. If initially there were 6 criteria, now there is a whole matrix of some numbers. To return to the criteria again, let's calculate the eigenvector of the matrix. The elements of this vector will be the relative importance of each criterion.

    Thomas Saaty's book offers several simplified methods for calculating the eigenvector in your head or on paper. We will use a more accurate iterative algorithm:

    N = number of criteria m = evaluation matrix of dimension NxN eigenvector = vector of dimension N filled with 1/N values ​​Repeat until eigenvalue starts to converge to a certain value or until we do the maximum allowed number of iterations x = m * eigenvector eigenvalue = sum(x) eigenvector = x / eigenvalue
    As a result, we get the following vector:
    The most significant criterion is time (0.3846), the least significant is career (0.0555).

    In pairwise comparisons, some estimates may be inconsistent. For example, for me, interest is more important than money, and money is more important than a career. Obviously, interest should be significantly more important than career. This is true in this table. But if the score for “interest-career” was smaller or even reversed, then my estimates would not be consistent with each other.

    The eigenvalue of the comparison matrix will help to assess the extent of this inconsistency. It is equal to 6.7048.

    Obviously, the eigenvalue is proportional to the number of criteria. To ensure that the consistency assessment does not depend on the number of criteria, the so-called consistency index = (eigenvalue - N) / (N - 1) is calculated.

    Finally, in order for the assessment to be completely objective, it is necessary to divide this index by the average consistency index for random matrices. If the resulting value (consistency ratio) is less than 0.1000, then pairwise comparisons can be considered more or less consistent. In our example, it is equal to 0.1137, which means that the calculated priorities can be more or less trusted.

    1.3 Evaluation of alternatives
    Now you need to compare all alternatives for each criterion.

    For example, if I move to Moscow, I will gain significantly in salary. But the work will most likely be less interesting, and there will also be less time for life. Or, when moving abroad, I will have to give up my language and adapt to other people's cultural values.

    For each criterion, an eigenvector and a consistency ratio are calculated.

    The resulting eigenvectors are written in columns:

    Consistency relations for each criterion are written in the following vector:
    [ 0,0337; 0,0211; 0,1012; 0,1399; 0,1270; 0,9507 ]
    Most values ​​are less than or slightly greater than 0.1000. However, for the criterion “culture” the consistency ratio turned out to be very large. This is due to the fact that I placed some of the ratings incorrectly. I wanted to give 7 for “don’t change anything - move abroad”, because living in hometown much more comfortable. But I mistakenly put it at 1/7.

    1.4 Prioritizing alternatives
    So, we assessed the criteria, hung a label on each alternative: which option is more expensive, which is more interesting, etc. Now it is necessary to evaluate the alternatives according to all criteria in total. To do this, it is enough to multiply the matrix

    To vector
    [ 0,0592; 0,2323; 0,3846; 0,0555; 0,1220; 0,1462 ]
    As a result, we get the following vector:
    [ 0,3184; 0,1227; 0,2049; 0,3540 ]
    This is the significance of the alternatives regarding achieving the goal.

    1.5 Decision making
    Now let’s plot all the calculated values ​​in the following figure:

    The ratio of assessment consistency is indicated in parentheses.

    The thickness of the lines is proportional to the priorities. The current job is the most interesting and promising in terms of career. Freelancing would allow you to spend more time in nature and spend more time on life. More profitable work in Moscow and abroad.

    It is clear that Moscow is completely disappearing. Abroad is a little better, but also not very good. Don’t change anything and freelancing is at about the same level.

    2 Creating a metamodel

    Now let's describe how all this is drawn and calculated.

    First, it is necessary to describe the metamodel: the types of entities that are used in the hierarchy analysis method. Moreover, unlike we will not draw the metamodel in the form of a diagram, but will describe it in the Xcore text notation.

    Let's focus only on the most interesting things. Xcore, unlike Ecore, allows you to describe not only the structure of the model, but also some logic in a Java-like language. Let us describe, for example, the data type for storing ratings. We will store positive scores as positive integers. And we will store inverse estimates of the form 1/n as -n. We could store the scores as strings or as real numbers, but that's probably a bad idea.

    That being said, we need two functions to convert scores from or to a string representation. On Xcore it will look like this:

    Type Weight wraps int create ( if (it.matches("\\d+")) ( Integer.parseInt(it) ) else if (it.matches("1\\s*/\\s*\\d+") ) ( val result = Integer.parseInt(it.replaceFirst("1\\s*/\\s*", "")) if (result<= 1) 1 else -result } else { throw new NumberFormatException("The weight must be either n or 1/n") } } convert { if (it >= 1) ( it.toString ) else if (it >= -1) ( "1" ) else ( "1/" + (-it).toString ) )
    Xcore also allows you to describe relatively complex logic.

    Here, for example, is the operation of calculating priorities in a hierarchy.

    class Hierarchy ( op void updatePriorities() ( priorities.clear inconsistencies.clear val mat = new JudgmentMatrix (criteria) val criteriaJudgments = judgments.filter(typeof(CriterionJudgment)).filter(cj | cj.goal == goal) for (judgment: criteriaJudgments) ( mat.set(judgment.first, judgment.second, judgment.weight) ) for (criterion: criteria) ( val GoalCriterionPriority priority = AHPFactory.eINSTANCE.createGoalCriterionPriority priority.goal = priority.criterion = criterion priority.value = mat.findEigenvectorElement(criterion) priorities.add(priority) ) val goalInconsistency = AHPFactory.eINSTANCE .createGoalInconsistency goalInconsistency.goal = goal goalInconsistency.value = mat.inconsistency inconsistencies.add(goalInconsistency) val mat2 = new Matrix(alternatives.size, criteria.size) criteria.forEach ] val mat4 = mat2.multiply(mat.eigenvector) alternatives .forEach ) )


    Finally, for the Xcore model (as well as for the Ecore model), you can create a class diagram.

    This is what the metamodel for the hierarchy analysis method looks like. This is the most simplified option. And in the general case, a hierarchy can contain more than three levels (for example, criteria can have subcriteria). Matrices of connections between levels can be sparse. Ratings can be given by several experts, not just one.

    This is what the chart and table editor specification looks like:

    This is what the resulting editor looks like:

    It was not possible to describe the hierarchy editor completely declaratively; I had to write extensions in Java. I think it's worth looking at this in a little more detail. Sirius has at least two extension options: service and action.

    With services, you can add some additional operations to classes from the metamodel. For example, the following two operations respectively format the priority and calculate the thickness of the connections between criteria and alternatives.

    Public class Service ( public String toString(Priority priority) ( return String.format("%.4f", priority.getValue()); ) public int getEdgeWidth(Alternative alternative, EdgeTarget targetView) ( DSemanticDecorator targetNode = (DSemanticDecorator)targetView; Criterion criterion = (Criterion)targetNode.getTarget(); Priority priority = alternative.getPriority(criterion); return (int) (priority.getValue() * 7); ) )
    Conveniently, you can use these operations directly in AQL expressions. However, you cannot use them to change the model.

    To change the model you need to use Java actions. Actions, unlike services, can no longer be called in AQL expressions. They can be launched, for example, via context menu or at the press of a button. Actions can be rolled back using the Undo command.