#### Abstract

We show how to define a plethora of metrics for graphsâ€”either full graphs or subgraphs. The method mainly utilizes the minimal matching between any two multisets of positive real numbers by comparing the multiple edges with respect to their corresponding vertices. In the end of this article, we also demonstrate how to implement these defined metrics with the help of adjacency matrices. These metrics are easy to be manipulated in real applications and could be amended according to different situations. By our metrics, one should be able to compare the distances between graphs, trees, and networks, in particular those with fuzzy properties.

#### 1. Introduction

In the real world, we face a lot of uncertain mathematical objects. Among them, some are easier to be formalized via graphs or tree structures or networks. Henceforth, the distances between such structures are vital as they provide deeper information between two different structures. In the article [1], we have shown how to define metrics for graphs with single-edged vertices. Single-edge graphs are graphs with at most one edge between any two vertices. Such graphical structures normally are deterministic. The basic idea is to, based on minimal matching concepts, define matched parts and mismatched parts of incoming or outgoing edges. However, due to the complexity of real applications, in particular some fuzzy or indecisive mathematical objects, the metrics we had defined in that paper are insufficient to cover the needs. Therefore, we put forward some novel metrics which could accommodate such complexity in this article. We would consider graphs with multiple edges between any two vertices. This mechanism could then be applied in modelling some indecisive objects. Our research is also partially motivated by some articles regarding fuzzy mathematical objects [2â€“5]. Furthermore, if one is interested in other variants of metrics for graphs, he could consult either [6] or [7].

#### 2. Multisets

Let us introduce some definitions and operations of multisets. Let denote the set of all positive real numbers. Let denote the set of all the natural numbers including 0. Let denote the set of all the functions . Let be the domain of a function . Let be the nonzero domain of . Define . In this article, we name each element in a multiset. Let be arbitrary multisets. We use the notation (i.e., is a multisubset of ) to denote that for all , .

*Definition 1 (empty multiset). *We call the zero function in the empty multiset.

*Definition 2 (equality ). * iff and .

*Definition 3 (intersection ). *The intersection of multiset and , denoted by the function , is defined by for all .

*Definition 4 (union ). *The union of multiset and , denoted by the function , is defined to be for all .

*Definition 5 (difference ). *Exclusion of multiset from , denoted by the function , is defined by for all .

Note that each multiset in could be uniquely represented by either a set of descending form as follows:or in short , or by a set of ascending form as follows:or in short , where and and for all . Define the cardinality of a multiset by .

*Definition 6 (descending order). *Define the -th element in by function as follows:

*Definition 7 (ascending order). *Define the -th element in by function as follows:

#### 3. Metrics

Let be a set of vertices and be a set of directed edges. Let denote the finite multipower set of . In this section, we show how to define metrics for labelled graphs and unlabelled graphs. The distance is mainly defined based on weights of the corresponding edges between the graphs.

*Definition 8. *We call a multiset-theoretic graph if and only if (1)For each ,(2)For all , every element in is non-negative and , where is a multiset-valued weight function. Let denote the set of all the multiset-theoretic graphs. The main purpose of this article is to define some metrics for which is divided into two categories: labelled vertices and unlabelled vertices.

*Definition 9. *Let denote the sum of all the elements in the multiset .

##### 3.1. Metrics for Labelled Graphs and Subgraphs

In this section, we show how to define the distance between any two graphs (whose vertices are all named) that could be graphs with either compatible or incompatible vertices. In this subsection, we assume all the vertices are labelled. To begin with, we show how to define metrics for . These metrics will serve as the foundations for further construction of metrics. By the representations of multisets in descending and ascending forms as shown in and , we have the following definitions. Based on the minimal matchings between any two multisets of positive real numbers [8], we derive the following metrics.

*Definition 10 (descending metric). *Define

*Definition 11 (ascending metric). *Define

*Definition 12 (halved metric). *Definewhere and .

In this article, we assume . Indeed and could be decided by some mechanisms. We omit this part.

*Example 13. *Suppose and . Then and . Hence . Suppose and . Then and . In the following, instead of explicitly showing the representative forms of a multiset, the distances of the corresponding form are understood from their contexts; for example, is deemed as , while is deemed as .

Lemma 14. * and are all metrics on .*

*Proof. *They follow from the absolute triangle property. Let be arbitrary. One could show the triangle property via the relation of cardinalities of , and . For a full proof, one could also consult the results in [8].

Now we need to develop much more complicated metrics via , and metrics. For each vertex, there are two approaches to define its adjacent vertices: inbound or outbound. Hence we have the following definitions. Define outbound setand inbound set

*Definition 15. *Define â€‰â€‰=â€‰â€‰andâ€‰â€‰â€‰â€‰=â€‰â€‰.

*Example 16. *Assume = , , , , , , , . Then and ; thus + + + = 33. Moreover, + = 17.

Let be arbitrary. We have the following abbreviations: (i);(ii);(iii);(iv). In this article, we put forward two equivalent categories of distance functions for subgraphs as follows.

*Definition 17 (outbound measure: descending). *

*Definition 18 (inbound measure: descending). *

*Definition 19 (outbound measure: ascending). *

*Definition 20 (inbound measure: ascending). *

*Definition 21 (outbound measure: halved). *

*Definition 22 (inbound measure: halved). *

Theorem 23. *â€‰â€‰ are all metrics;**â€‰â€‰.*

*Proof. *They all follow from the definitions, in particular the property of set difference and the facts that , and are all metrics. For a full proof, one could also consult the results in [1, 8].

Since , we use , , and to represent them, respectively, in the following.

##### 3.2. Metrics for Unlabelled Graphs and Subgraphs

In this section, we show how to define the distance between any two graphs (whose vertices are all unnamed) that could be either compatible or incompatible graphs. Since all the vertices are unnamed, the distance could not be defined as the one in the labelled cases. Hence all the possibilities of the interactions between and (whose vertices are all unnamed) should be taken into consideration. However, we could fix one graph, say , and permute . Then one computes all the possible distances and chooses the optimal permutation of , in the sense of minimal distance. Let denote the -th graph whose vertices are identical to with -permutation of the names for the vertices. indeed is treated as a naming system. There are ways of assigning the names to the unnamed set . Based on metrics , we define the unlabelled distances as follows.

*Definition 24. *.

*Definition 25. *.

*Definition 26. *.

Theorem 27. *, and are all metrics.*

*Proof. *They follow from the definitions. For a full proof, one could also consult the results in [1, 8].

#### 4. Computations and Implementations

In this section, we show how to implement all the above-mentioned metrics via adjacency matrices. Let . Suppose is the set of all the graphs whose vertices are comprised of part or all of . Let defined as follows.

, ,, and , where , , and ; ; and are defined as follows:

##### 4.1. Computations for Labelled Full Graphs

We call and full graphs. Based on the definitions regarding their components of distances, we have the following computations (which correspond to the original definitions, in matrix form): and .

and . Furthermore, .

##### 4.2. Computations for Labelled Subgraphs

We call and subgraphs. To begin with, we show how to compute the distance between a full graph and a subgraph. Their interactive components of distances are illustrated in the following matrix form:

and .

and . Furthermore, .

Now we show how to implement the computation of the distance between any two subgraphs via a matrix form and its norm as follows:

and and . Furthermore, .

##### 4.3. Computations for Unlabelled Full Graphs

Suppose the vertices in are all unnamed. To compute the distance between unnamed and , according to the definition, we need to pick the smallest distances between and for . To implement this, we fix the adjacency matrix of and permutes the adjacency matrix of and compute all the respective distances and then choose the least one and its resulting permutation. Through computation, we have the following result:

By setting as follows: for some unique , one has .

Similarly, by setting as follows: for some unique , one has . Furthermore, .

##### 4.4. Computations for Unlabelled Subgraphs

As for the , after our computations, the optimal corresponding subgraph in is the truncated one with vertex lying in ; i.e., the optimal subgraph with respect to is . Then . Similarly, the optimal subgraph with respect to is . Then . Furthermore, . By setting as follows: for some unique , one has . By setting as follows: for some unique , one has .

To sum up all the results regarding different metrics and graphs, we have Table 1.

There are several observations worth mentioning:(1);(2)the distance between a full graph and a subgraph is higher than either the distances for full graphs or the subgraphs;(3)the distance between unlabelled graphs is less than or equal to the one between labelled ones.

All these results agree with our theoretical definitions and derivations.

#### 5. Real World Application

In this section, we demonstrate how to make a decision via our derived metrics when facing some uncertain situation in the real. Suppose country Bâ€™s strategic deployment of air planes depends on country Aâ€™s attack force. The degree of attack force ranges from 0 to 100, in which 0 indicates that there is no loss in the combat while 100 indicates the opponentâ€™s airbase is completely wiped out. Suppose A and B both have fives airbases in other countries C1, C2, C3, C4, and C5. Suppose A has 6 types of air planes A1, A2, A3, A4, A5, and A6. The number of each type of planes installed across different countries is listed in Table 2. Their respective attack forces are 30, 45, 55, 76, 88, and 97. Suppose Bâ€™s observation of Aâ€™s planes and air flight of his planes from one base to other bases is recorded in Tables 3 and 4. The potential flights from one base to other bases for A are listed in Table 2. This table could be directly converted into an adjacency matrix (named ), in which â€śnoneâ€ť is replaced by 0 and contents in each is rewritten in the forms of sets. Suppose B has 7 types of air planes: B1, B2, B3, B4, B5, B6, and B7. Their respective attack forces are 28, 41, 46, 52, 61, 70, 86. Suppose B owns ,,,,,, and planes for each corresponding type. Now the problem for B is how he should send his air planes to counterbalance his opponent. Based on the metrics in this article, we could make a decision toward such uncertain situation. Let denote the numbers of air flight of Aâ€™s and Bâ€™s air planes from airbase to . DefineThe optimal decision for B to counterbalance A iswhere . Their individual solutions could be obtained via integer programming. Here we omit the final execution. If there is inconsistency between the choices of , one could resort to subjective judgement or assigning weights between and to reach a final decision.

#### 6. Conclusion

In this article, we have shown how to define distances between graphs over either a set of labelled or unlabelled vertices via a plethora of metrics for graphs. We also give computational approaches to implement the computation of these metrics via the operations on adjacency matrices. This implementation gives an efficient and fast computation of the distance between any two such graphs. We also demonstrate how to apply these metrics in uncertain decision-making. Indeed, these metrics could be further applied in measuring the distance between real networks or tree-like structures.

#### Data Availability

No data were used to support this study.

#### Conflicts of Interest

The author declares that there are no conflicts of interest regarding the publication of this paper.

#### Acknowledgments

The work is supported by the Natural Science Foundation of Fujian Province of China (Grant no. 2017J01566).