1. Introduction and Preliminaries
Algebraic graph theory is an interrelated research field that explores the fundamental relationships between algebra and graph theory [
1,
2]. It focuses on how algebraic structures such as groups, rings, and semigroups can be viewed and explored by using graphs, allowing graph-theoretic methods to expose algebraic aspects and vice versa. In 1878, Cayley [
3] laid the foundation of this field by introducing Cayley graphs to represent groups graphically, offering visual and structural insight into group operations and symmetries. Later, in 1988, Beck [
4] made a significant contribution to this field by introducing the concept of zero-divisor graphs for commutative rings. In this construction, the vertex set consists of non-zero zero-divisors of the ring, and two unique members are neighboring if their product is zero. This graphical form has been effective for understanding ring-theoretic characteristics like annihilators, ideals, and prime elements. Following Beck’s work, numerous authors expanded and generalized this concept. Anderson and Livingston [
5] developed the zero-divisor graph by focusing primarily on non-zero zero-divisors, while Anderson and Badawi [
6,
7] investigated modifications such as entire graphs and ideal-based graphs, providing more information about the structure of commutative rings. Recently, different mathematicians [
8,
9,
10,
11,
12] have assigned graphs to numerical semigroups and studied some properties of the graphs.
Graphs are widely used across numerous disciplines, including computer science, biology, communication networks, and operations research, due to their ability to abstractly represent complex systems, such as transportation routes, social interactions, molecular structures, and data networks [
13,
14]. In particular, bipartite graphs based on algebraic concepts are important for expressing interactions in chemical reaction networks and metabolic pathways [
15]. This collaboration not only enriches the theoretical foundations of both fields but also helps to solve real-world problems using a combined algebraic-combinatorial perspective.
A graph consists of a finite set of vertices V and a set of edges E, where each edge connects a pair of vertices. The neighborhood of a vertex v in a simple undirected graph , denoted by , is the set of all the vertices adjacent to v, and its cardinality is known as a degree of v, denoted by . The diameter of a graph is the greatest distance between any pair of vertices in the graph, denoted by . A cycle is a closed path with no repeated edges or internal vertices, and the girth of a graph is defined as the length of its shortest cycle, represented by . A path graph is a simple linear graph where each internal vertex is adjacent to exactly two others, and the endpoints have a degree 1. A graph is said to be complete if every pair of distinct vertices is joined by an edge. A bipartite graph admits a vertex partition into two disjoint sets such that all the edges connect vertices across the sets, with no edges within a set. It is said to be balanced if both parts have equal cardinality. A regular graph is one in which all the vertices have the same degree, reflecting a uniform local structure.
In algebraic and applied contexts, graph invariants such as diameter and girth play pivotal roles in understanding both abstract structure and practical behavior. Within the algebraic framework of numerical semigroups, a small diameter in the associated gap poset graph reflects tightly interrelated gaps, often corresponding to semigroups with smaller multiplicity or denser Apéry sets. It is a property that directly relates to efficiency and robustness in real-world networks. For example, in communication networks, diameter is used to evaluate the Diameter-Constrained Reliability (DCR), which measures the probability that two nodes remain connected by a path not exceeding a prescribed length bound. This has practical implications in designing networks with bounded delays and fault tolerance, where minimizing diameter ensures faster data transmission and resilience to failures. Research such as [
16,
17,
18,
19,
20,
21] has highlighted that computing DCR is generally NP-hard, but exploiting diameter-based properties allows identification of specific topologies where reliability can be computed in polynomial time. Thus, the study of graph diameter not only advances algebraic graph theory but also plays a key role in optimizing communication systems, transportation routes, and distributed computing architectures. Girth reveals redundancy or minimal algebraic relations among gaps. A small girth may indicate fundamental additive relations in the gap structure. Beyond theory, these invariants are widely used in network reliability and optimization. Networks with low diameter ensure high communication efficiency and resilience, while high girth avoids short feedback loops that can destabilize systems [
22].
A numerical semigroup is a subset
that is closed under addition, contains the zero element, and has a finite complement in
. The elements of
are called gaps, and their total number is the genus
of the semigroup. The Frobenius number
is the largest integer not in
, and the multiplicity is the smallest non-zero element of
, denoted by
. Given a nonempty set
, the submonoid generated by
A, denoted
, is a numerical semigroup if and only if
. Every numerical semigroup has a unique minimal system of generators, and the number of these generators defines the embedding dimension
. The Frobenius problem [
23,
24] explores formulas for calculating the Frobenius number and genus of a numerical semigroup. Sylvester solved this problem in [
25] for numerical semigroups with embedding dimension two. Because of their applications in coding theory, algebraic geometry, and factorization theory, numerical semigroups have received much attention in algebraic and combinatorial research over the last few decades. Several structural features have been investigated, including symmetric, pseudo-symmetric, and nearly symmetric semigroups [
26]. The link between numerical semigroups and Apéry sets, Kunz coordinates, and their representation through combinatorial objects such as trees and posets has been widely studied in the literature [
27,
28], providing powerful tools for categorization and computing.
Partially ordered sets (posets) are mathematical structures composed of elements connected by a binary relation that is reflexive, antisymmetric, and transitive. This framework allows for the representation of relationships where not all the elements are comparable, making it useful in various fields, including computer science, combinatorics, and chemistry. Wachs [
29] provided a comprehensive overview of poset theory and its connections with topology, particularly in understanding the structure of order complexes. Felsner et al. [
30] proposed the concept of poset dimension, which has been further examined in following surveys, showing how posets can be represented as linear-order intersections and how this relates to computing complexity. De Loof et al. [
31] demonstrated that posets may be utilized for multi-criteria ranking, which is useful in decision-making systems like chemical assessments and preference models. Posets also have a role in coding theory as they are utilized to define novel distance measures for error correction, as explained in Springer’s work on poset metrics. Additionally, posets have been extensively studied in the context of algebraic structures such as distributive lattices and Boolean algebras, leading to significant results in universal algebra and logic [
32].
Posets are commonly formed in algebraic combinatorics from monomial ideals, numerical semigroups, and group actions, and they provide a convenient framework for defining simplicial complexes, resolving homological dimensions, and storing algebraic constraints in graphical form.
Several computational tools exist for the study of numerical semigroups, most notably the numericalsgps package in the GAP system, which provides a wide range of algebraic and combinatorial functionalities. While these packages are powerful, they often require familiarity with specialized algebraic software and may not provide immediate visualization features for graph structures. Our approach differs in that it leverages Python version 3.13.5, a widely accessible programming language, together with graph-theoretic libraries such as NetworkX and visualization packages like Matplotlib version 3.5. This makes it possible to construct, analyze, and visualize gap poset graphs in an integrated manner. Furthermore, our method is easily extensible to compute new invariants that are not yet implemented in standard packages. Thus, while the existing software emphasizes algebraic operations on semigroups, our contribution lies in providing a flexible user-friendly framework that directly bridges numerical semigroup theory with graph theory and visualization.
The remainder of this paper is organized as follows. In
Section 2, we determine the conditions under which bipartite gap poset graphs are connected or disconnected. In
Section 3, we characterize the bipartite gap poset graphs into different well-known families of graphs. In
Section 4, we provide a bound on the diameter and a conjecture on the upper bound of the girth of a bipartite gap poset graph. In
Section 5, we present the algorithms for constructing gap poset graphs, along with procedures to compute key graph invariants, such as diameter and girth. This paper concludes in
Section 6.
2. Some Results on Connectedness of Bipartite Gap Poset Graphs
Let
, where
is the set of gaps of numerical semigroup
, and then
if and only if
. Evidently,
is a poset. An undirected simple graph
is a graph such that
and
A numerical semigroup
is elementry if and only if
. This implies that gap set
of
is of the form
, where
. It is demonstrated in [
33] (see Theorem 2) that, if
is empty, then
is an edgeless graph. In this paper, we consider
is always non-empty, and therefore
. The following theorem demonstrates correspondence between the elementary numerical semigroups and the bipartite gap poset graphs.
Theorem 1. A numerical semigroup is elementary if and only if the gap poset graph is a bipartite graph.
Proof. This implication follows from Lemma
of [
33].
Suppose
is a bipartite graph but
is not an elementary numerical semigroup. Then, from Theorem
of [
33], it follows that girth of
is 3, which is not possible as
is a bipartite graph. Hence,
is an elementary numerical semigroup. □
In the rest of paper, we denote a bipartite gap poset graph by . The following lemma provides us necessary and sufficient conditions for the connectedness of in terms of the Frobenius number of .
Lemma 1. Let be a bipartite gap poset graph and , where and . Then, the following statements hold:
- (1)
If is connected, then .
- (2)
If and for every , , then is connected.
Proof. (1) If
, then
for some
. Note that
as min
and max
. This implies
has no edge with any vertex of
. This is a contradiction as
is a connected graph; therefore, the Frobenius number of
must be
.
(2) We need to show that there is path between every two distinct vertices . For this, we have the following cases:
Case-1: If , then there exist some such that is a path between u and v.
Case-2: Let , and then we may assume that and , where with . This implies there exist such that has an edge with and has an edge with since . Consider for some . This implies a path between u and v is .
Case-3: Let and . Assume that for some . If , then u and v are connected by an edge, so we have . Now, if , then there exist some for some such that . □
If , then may be disconnected (see the following example).
Example 1.
Let , and then gap poset of is The corresponding graph is given in Figure 1. Clearly, , but is a disconnected graph. 4. Diameter and Girth of Bipartite Gap Poset Graphs
In this section, we provide some bounds for the diameter and the girth of bipartite gap poset graphs .
Lemma 2.
Let order of be . If , then is disconnected.
Proof. Clearly, two vertices
and
have an edge only if
for some
. This implies deg
, for every
. Since
, then
and
This provides
This implies
is disconnected. □
Theorem 6. Let order of be . Then, if and only if .
Proof. If
, then gap poset for
is
Note that
and
, while
, for
and
, for
. This implies deg
deg
. Also, for each
and
,
if and only if either
or
. This implies
Consequently, we obtain the required result.
Conjecture 1. Let be a bipartite gap poset graph. If is the multiplicity of numerical semigroup , then diam.
Now, we propose the following conjecture for the girth of bipartite gap poset graphs.
Conjecture 2. Let be a connected bipartite gap poset graph containing a finite cycle. If is the multiplicity of numerical semigroup , then one of the following statements hold:
- (1)
If is odd, then .
- (2)
If is even, then .
In the following results, we prove this conjecture for connected bipartite gap poset graphs of order .
Proposition 3.
Let be a connected bipartite gap poset graph of order containing a finite cycle, and then where is an odd number.
Proof. First of all, we show that there is some
such that
contains a cycle of length
. For this, we consider
Note that two vertices
are connected if and only if
Since
and graph is connected, then
For each
, we have
This implies
, and
This implies the total number of pendent vertices of
is
Clearly,
, but it is not part of any cycle. Thus, only
vertices are part of a cycle. The above discussion implies
is a graph as in the
Figure 2.
Now, we have to show that, for any
, graph
does not contain a cycle of length greater than
. For this, we take
where
and
. Since
therefore
Also, deg
since an element
has an edge if it satisfies the following condition:
Note that
This implies the total number of pendent vertices of
is
and
This indicates that the number of vertices with degree greater than 1 is less than
. This implies
cannot contain a cycle of length greater than
.
If
and
then
This implies is either a path or disconnected graph, which is not possible.
If
and
, then there exists a cycle
Consequently, there is no cycle of length greater than .
If
then there exists a cycle
This implies there is no cycle of length greater than .
□
Proposition 4.
Let be a connected bipartite gap poset graph of order containing a finite cycle, and then where is an even number.
Proof. Consider
and then for
the graph
contains a cycle of length 6 given as follows
Now, we have to show that, for any
, graph
does not contain a cycle of length greater than 6.
If
, then there is a cycle of length 6 in
, given as follows
If
then
This implies the corresponding graph is disconnected.
If
then the following cycle is contained in the graph
:
If
then the graph
contains a cycle
Consequently, we obtain gr( □
5. Algorithms and Python-Based Illustrations
In this section, we propose the algorithms and their Python implementations, followed by illustrative examples, as well as their application in chemical reaction networks.
Time complexity and space complexity of Algorithm 1 are quadratic and equal to
,
, respectively, where
K is the number of minimal generators of the numerical semigroup and
M is computed upper bound. For two generators
a and
b,
, and for more than two generators
.
Algorithm 1 Construction of Gap Poset Graph of a Numerical Semigroup |
- Input:
, the minimal system of generator of numerical semigroup - Output:
Gap poset graph
- 1:
- 2:
- 3:
while do - 4:
- 5:
if current > max_limit then - 6:
continue - 7:
end if - 8:
if then - 9:
add current to - 10:
for all do - 11:
push to frontier - 12:
end for - 13:
end if - 14:
end while - 15:
- 16:
if then - 17:
- 18:
else - 19:
- 20:
end if - 21:
, - 22:
Repeat step - 23:
- 24:
Initialize empty gap poset graph - 25:
for all
do - 26:
if then - 27:
Add edge to gap poset graph - 28:
end if - 29:
end for - 30:
return
|
Time complexity is cubic
, and space complexity is quadratic
of Algorithm 2, where
K is the number of minimal generators of numerical semigroups and
M is computed upper bound. For two generators
a and
b,
, and for more than two generators
. To assist researchers and support the validation and exploration of results in the study of numerical semigroups, we developed a Python-based tool that allows users to construct gap poset graphs derived from a given numerical semigroup
. The tool provides functionality to compute important graph invariants, such as the diameter and girth of the resulting gap poset graphs. The tool can be accessed through the following link:
https://gap-poset-graph-analyzer.onrender.com/ (accessed on 22 July 2025).
Algorithm 2 Compute the Diameter and the Girth of Gap Poset Graph |
- Input:
the minimal system of generator of numerical semigroup - Output:
Diameter and the girth of gap poset graph
- 1:
if length of generators is 2 then - 2:
Let sorted generators - 3:
- 4:
max_limit - 5:
else - 6:
max_limit - 7:
end if - 8:
Initialize numerical semigroup and frontier queue with 0 - 9:
while frontier is not empty do - 10:
Pop current element - 11:
if current > max_limit then continue - 12:
end if - 13:
if current then - 14:
Add current to - 15:
for all do - 16:
Append to frontier - 17:
end for - 18:
end if - 19:
end while - 20:
- 21:
Create empty graph and add as nodes - 22:
for all pairs in do - 23:
- 24:
if then - 25:
Add edge to - 26:
end if - 27:
end for - 28:
if is connected then - 29:
Compute and return diameter - 30:
else - 31:
Report number of components; diameter not defined - 32:
end if - 33:
Compute girth via BFS: - 34:
for node in a subset of do - 35:
Perform BFS and track shortest cycles - 36:
if cycle of length 3 found then - 37:
return 3 as girth - 38:
end if - 39:
end for - 40:
Return minimum cycle length as girth (or ∞ if none)
|
Example 2.
Let , and then we can use the following Python code to calculate the gap poset graph and its diameter and girth (see Listing 1).
As illustrated in
Figure 3, the ordered set of nodes
forms the shortest cycle in the graph. Since each pair of consecutively listed nodes is connected by an edge, this implies shortest cycle has length 12, which establishes the girth of
as 12. Furthermore, the largest distance between any two vertices occurs between nodes 14 and 10, yielding graph of diameter 9.
Listing 1. Python console output. |
![Axioms 14 00669 i001 Axioms 14 00669 i001]() |
Suppose a synthetic chemist needs to transform an initial molecular state (a short oligomer or intermediate) into a target state (a longer oligomer or final product) by a sequence of elementary reactions. Each elementary reaction can change molecular size by a quantity belonging to a fixed set of allowed step sizes (for instance, additions of building blocks of sizes given by available reagents). We model the allowed step sizes by gaps of numerical semigroup such that nodes represent molecular species (substrates, intermediate, and product) and edges correspond to stoichiometrically possible reaction steps. The gap poset graph indicates hypothetically how many one-step reactions take place (i.e., direct edge between vertices) and two-step reactions (i.e., there is a vertex between two independent vertices that link with both of them) and so on. Diameter and girth of gap poset graphs provide information about how long any synthesis path can be and on the minimal length of possible cycles, which helps chemists and engineers to estimate worst-case synthesis depth and detect when a proposed reagent set is intrinsically inefficient. Also, it helps us in energy minimization, yield optimization, selection of catalyst, and alternative reagents.
Example 3.
Let , and then we can use the following Python code to compute the gap poset graph and its diameter and girth (see Listing 2).Listing 2. Python console output. |
![Axioms 14 00669 i002 Axioms 14 00669 i002]() |
As illustrated in
Figure 4, the ordered set of nodes
forms the shortest cycle in the graph. Since each pair of consecutively listed nodes is connected by an edge, this implies shortest cycle has length 4, which establishes the girth of
as 4. Furthermore, the largest distance between any two vertices occurs between nodes 7 and 9, yielding graph has diameter
6. Conclusions
In this article, we investigated various structural properties of bipartite gap poset graphs associated with numerical semigroups. In
Section 2, we determined the specific conditions under which they are connected or disconnected, providing insight into how the arrangement of gaps affects the overall structure. In
Section 3, we concentrated on the characterization of bipartite gap poset graphs, in which we investigated how various configurations corresponded to different well-known graph types, such as balanced, path, and star. In
Section 4, we provided a bound on the diameter of bipartite gap poset graphs. Additionally, we provided a conjecture on the upper bound of the girth of bipartite gap poset graphs. These findings help to deepen our understanding of the interaction between the additive structure of numerical semigroups and the combinatorial features of their related graphs, as well as open up new possibilities for research in algebraic graph theory. In
Section 5, we presented the algorithms for constructing gap poset graphs, along with procedures to compute key graph invariants such as diameter and girth. Additionally, this section includes illustrative examples that demonstrate the practical application and effectiveness of the proposed methods.
The future extension is to investigate gap poset graphs beyond the bipartite case, exploring richer families of numerical semigroups and the new structural patterns they generate. Furthermore, studying additional graph invariants, including the chromatic number, domination number, and metric dimension of these graphs, would provide deeper insights into their structural and combinatorial properties.