Abstract

Let and be graphs. A mapping from to is called a weak homomorphism from to if or whenever . A ladder graph is the Cartesian product of two paths, where one of the paths has only one edge. A stacked prism graph is the Cartesian product of a path and a cycle. In this paper, we provide a formula to determine the number of weak homomorphisms from paths to ladder graphs and a formula to determine the number of weak homomorphisms from paths to stacked prism graphs.

1. Introduction

Let and be graphs. A mapping is a homomorphism from to if preserves the edges, i.e., if , whenever . We denote the set of homomorphisms from to by Hom. Let denote a path of order such that and . Let denote a cycle of order such that and , where is the addition modulo . Furthermore, we will refer to [1, 2] for more information about graphs and algebraic graphs.

The formula for the number of homomorphism from to itself, End, was stated by Arworn [3] in 2009. Arworn [3] transformed the problem into counting the numbers of shortest paths from the point (0, 0) to any point in an -ladder square lattice and obtained a concise formula.

In general, a homomorphism from to itself is called an endomorphism on . Clearly, the set of endomorphisms on forms a monoid under a composition of mappings.

For a mapping , we say that contracts an edge if . A mapping is called a weak homomorphism from a graph to a graph (also called an egamorphism) if contracts or preserves the edges; i.e., if , then or . A weak homomorphism from to itself is called a weak endomorphism on . We denote the set of weak homomorphisms from to by WHom and the set of weak endomorphisms on by WEnd. Clearly, WEnd forms a monoid under a composition of mappings.

The composition of (weak) homomorphisms is also a (weak) homomorphism. When we have a collection of objects and morphisms between them, satisfying certain properties such as composition and identity, we can define a category. In this context, the category consists of graphs as objects and (weak) homomorphisms as morphisms, where the composition of (weak) homomorphisms and the identity (weak) homomorphism for each graph form the necessary structure [1]. It provides a structured way to study and analyze relationships between graphs, allowing for a wide range of applications, including graph database querying, graph theory research, and network analysis. The choice between strong (graph) homomorphisms and weak graph homomorphisms in the category can lead to different ways of capturing and studying relationships between graphs, depending on the specific requirements of the problem at hand.

Given a graph product , the cancellation problem for the product is the conditions under which implies . The problem is simple when is the Cartesian product □. Consequently, we assert that cancellation holds for the Cartesian product. It is much more complicated for the direct product and the strong product . In the case of the direct product of graphs, if there exist homomorphisms from to and from to , then [4]. By utilizing the fact that WHom()WHom()WHom() for all finite simple graphs and , and for all finite graphs where loops are admitted, cancellation also holds for the strong product of graphs [4].

In 2010, Sirisathianwatthana and Pipattanajinda [5] provided the number of weak homomorphisms of cycles WHom in terms of the collection of () where () is a set of weak homomorphisms from to , where and .

Motivated by Arworn’s work [3], in 2018, Knauer and Pipattanajinda [6] used a cubic lattice and an -ladder cubic lattice to construct the number of weak endomorphisms on paths WEnd. Moreover, they provided formulas for the number of shortest paths from the point (0, 0, 0) to any point , as in Proposition 1. Figures 1 and 2 represent the cubic lattice and the 2-ladder cubic lattice when , and , respectively.

Proposition 1. (see [6]). The numbers and of the shortest paths from the point to any point in the cubic lattice and in the -ladder cubic lattice are as follows:respectively.

For any two graphs and , the Cartesian product of and is the graph with vertices , for which is an edge if and , or and . The ladder graph is the Cartesian product of and . The stacked prism graph is the Cartesian product of and .

We see that a mapping is a homomorphism if and only if is a walk in . We thus get a one-one correspondence between the set of homomorphisms and the set of walks of vertices in . In the same manner, we can see that there is a one-one correspondence between the set WHom and the set of partial walks of vertices in , where the partial walk is a sequence obtained by joining walks for some with the ending vertex of being the starting vertex of for all .

In this paper, we are interested in finding the number of weak homomorphisms from paths to ladder graphs, , and from paths to stacked prism graphs, . These give the numbers of partial walks of vertices in and . Here, we generalize the original cubic lattice by adding double edges and triple edges in the backward directions and obtain a double-bridge cubic lattice and a triple-bridge cubic lattice as in Figures 3 and 4, respectively. Similarly, we obtain an -ladder double-bridge cubic lattice and an -ladder triple-bridge cubic lattice (see Figures 5 and 6).

The number of shortest paths from the point (0, 0, 0) to any point in a double-bridge cubic lattice and in an -ladder double-bridge cubic lattice is as follows.

Proposition 2. The numbers and of shortest paths from the point to any point in the double-bridge cubic lattice and in the -ladder double-bridge cubic lattice are as follows:respectively.

Proof. To obtain the shortest path, at any instance, from the point , one can only go to , , or . Since there are double bridges, there are two possible ways to visit , namely, through the dashed line and through the dotted arc. We denote the move to the right by R, the move up by U, the move to the back through the dashed line by , and the move to the back through the dotted arc by . The number of shortest paths from the point to any point in the double-bridge cubic lattice is equal to the number of different arrangements of R’s, U’s, u’s, and ’s, where . Thus, While the number of shortest paths from the point to any point in the -ladder double-bridge cubic lattice is equal to the number of different arrangements of R’s, U’s, B’s, and B’s, where , and R always appears before U. Therefore, Similarly, in a triple-bridge cubic lattice, there are three possible ways to move from the point to the point . Thus, we obtain the following proposition analogously.

Proposition 3. The numbers and of the shortest paths from the point to any point in the triple-bridge cubic lattice and in the -ladder triple-bridge cubic lattice are as follows:respectively.

2. The Number of Weak Homomorphisms from Paths to Ladder Graphs

In this section, we provide the formula for finding the number of weak homomorphisms from paths to ladder graphs . We denote the set of weak homomorphisms from to , which maps 0 to by . By the symmetry of , we obtain the following lemma.

Lemma 4. Let and be integers such that .(1).(2).(3).

To gain insight into the main theorem, we begin by observing a simple example. In this step, we aim to visualize weak homomorphisms. Figure 7 shows the possible weak homomorphisms from to , which map 0 to (0, 0). The numbers on the top are elements of the domain set , and the tuples on the left are elements of the image set .

The mapping with and is represented by the dotted arcs on the top and black line (see Figure 8). We noted that normal lines represent the change in the first coordinate, dotted arcs represent the change in the second coordinate, and dashed lines indicate no change in coordinates.

Figure 9 visualizes weak homomorphisms using the double-bridge cubic lattice. There are multiple cases to be considered. First, correspond to moving from to . Second, correspond to moving from to . For the remaining cases, correspond to moving from to through the dotted arc and correspond to moving from to through the dashed line. Therefore, the mapping is represented by a shortest path from to and (3, 0, 0) in the 0-ladder double-bridge cubic lattice, respectively.

Cardinality is the summation of and , where (large black points). Based on Figure 10, if and , we use ; otherwise, :

Similar to the above example, Figure 11 visualizes all possible weak homomorphisms of the path to that map 0 to (1, 0).

Cardinality is the summation of and , where (large black points). Based on Figure 12, if and , we use ; otherwise, :

In general, to find , we use to compute the number of shortest paths from (0, 0, 0) to when , and we use when ; otherwise, we use .

Theorem 5. Let be a positive integer and be a nonnegative integer such that . It follows thatwhere .

Proof. Let . To find , we count the number of shortest paths from the point to any point , where in the -ladder double-bridge cubic lattice. We consider the following three cases corresponding to the value of .

If , then for each , there are shortest paths. Figure 13 displays possible end points when by big circles, while small circles stand for all possible origins of dashed lines with an end point .

Since , we obtain the following equation:

We replace and with and , respectively, and the total number of shortest paths is as follows:

If and , then for each , there are shortest paths.

This contributes . Figure 14 displays a possible end point by the big circle, while small circles stand for all possible origins of dashed lines with an end point .

We replace and with and , respectively, and the total number of shortest paths is as follows:

If and , then for each , there are shortest paths. This can be obtained by flipping the cubic lattice diagonally. Figure 15 displays possible end points when by big circles, while small circles stand for all possible origins of dashed lines with an end point .

Since , we obtain the following equation:

We replace and with and , respectively, and the total number of shortest paths is as follows:

Adding up over all cases, is as desired.

3. The Number of Weak Homomorphisms from Paths to Stacked Prism Graphs

In this section, we provide the formula for finding the number of weak homomorphisms from paths to stacked prism graphs . We denote the set of weak homomorphisms from to , which maps 0 to by . By the symmetry of , we obtain the following lemma.

Lemma 6. Let and be integers such that , and let be a positive integer.(1), for all .(2).(3).

Similar to the previous section, we provide some insight via examples. Figure 16 shows all the possible weak homomorphisms from to , which map 0 to (0, 0). The numbers on the top are elements of the domain set , and the tuples on the left are elements of the image set . Figure 17 visualizes weak homomorphisms using the triple-bridge cubic lattice, where the move from to the next point is depicted as follows:(1)To , if .(2)To , if .(3)To through the dashed line, if .(4)To through the dotted upper arc, if .(5)To through the dotted lower arc, if .

Note that is the addition modulo for the second coordinate of images. Again, normal lines in Figure 16 represent the change in the first coordinate, dotted arcs represent the change in the second coordinate, and dashed lines indicate no change in coordinates.

Therefore, the mappings with , and are represented by the dotted arcs on the top and black line, respectively (see Figure 18). The mapping is represented by the shortest path from to and (3, 0, 0) in the 0-ladder triple-bridge cubic lattice, respectively (see Figure 19).

Cardinality is the summation of and , where (large black points). Based on Figure 17, if and , we use ; otherwise, :

Similar to the abovementioned example, Figures 20 and 21 visualize the possible weak homomorphisms of the path to , which map 0 to (1, 0). We then use the 1-ladder cubic lattice, since for some .

Cardinality is the summation of and , where (large black points). Based on Figure 21, if and , we use ; otherwise, :

In general, to find , we use to compute the number of shortest paths from (0, 0, 0) to when , and we use when ; otherwise, we use .

Theorem 7. Let be positive integers and be a nonnegative integer such that and . It follows thatwhere .

Proof. Analogously to the proof of Theorem 5, we replace and with and , respectively. The theorem is proved.

4. Main Results

From Lemma 4 and Theorem 5, we obtain the theorem as follows.

Theorem 8. The cardinalities of weak homomorphisms from undirected paths to ladder graphs are as follows:wherewith .

From Lemma 6 and Theorem 7, we obtain the theorem as follows.

Theorem 9. The cardinalities of weak homomorphisms from undirected paths to stacked prism graphs are as follows:wherewith .

The algorithmic complexity of the evaluation of the formulas is for memoryless computation. This complexity can be toned down to using linear space memory. The computed and for and on a logarithmic scale are presented in Figure 22. Although the number of weak homomorphisms from paths to ladder graphs and stacked prism graphs is not bounded, one can conjecture that the asymptotic behaviour of the formulas, depending on , is in exponential form.

Data Availability

No underlying data were collected or produced in this study.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Acknowledgments

This research was supported by the Faculty of Science of Chiang Mai University and Chiang Mai University, Thailand.