Ideal Basis in Constructions Defined by Directed Graphs

The present article continues the investigation of visible ideal bases in constructions defined using directed graphs. This notion is motivated by its applications for the design of classication systems. Our main theorem establishes that, for every balanced digraph and each idempotent semiring with identity element, the incidence semiring of the digraph has a convenient visible ideal basis. It also shows that the elements of the basis can always be used to generate ideals with the largest possible weight among the weights of all ideals in the incidence semiring.


Introduction
The investigation of semirings is an important direction of theoretical computer science (cf. [9,27,52,58,62]) and symbolic computation (cf. [57]), where many efficient semiring-based algorithms have been developed (cf. [54]). In graph theory, semirings have been applied, for example, to the investigation of trust networks defined as directed graphs [23], to the study of planar flows of directed graphs [28], and to the design of a sophisticated Python library for parallel graph computations [56].
The construction of incidence semirings of directed graphs was introduced in [7]. To illustrate the applicability and usefulness of this notion, we include a section with examples, theoretical results and open questions concerning relations between properties of digraphs and properties of their incidence semiring (see Section 3). These examples confirm that the general problem of investigating the relations of properties of digraphs and their incidence semirings is interesting.
The main theorem of this paper handles two-sided ideals in incidence semirings of digraphs (Theorem 4.1 in Section 4). The concept of an ideal is important and has been used in various research directions. Visible ideal bases were introduced in [7] by analogy with different constructions (cf. [29,49]). Our main theorem establishes that, for each balanced digraph D and every idempotent semiring R with identity element, the incidence semiring I D (R) always has a convenient visible ideal basis B D (R), and elements of B D (R) can be used to generate two-sided ideals with the largest possible weight among the weights of all two-sided ideals in the incidence semiring (see Theorem 4.1). Complete definitions of these terms are given in the next section.

Preliminaries
We use standard terminology and refer the readers to the monographs [14,30,33,34,53,59] and articles [13,19,22,47,46] for more information. Throughout the word 'digraph' means a finite directed graph without multiple parallel edges but possibly with loops, and D = (V, E) is a digraph with the set V of vertices and the set E of edges.
Following [8], we do not assume that all semirings have identity elements. This makes it possible to consider incidence semirings for larger classes of digraphs. More specifically, a semiring is a set R with addition + and multiplication · satisfying the following conditions: (1) (R, +) is a commutative semigroup with zero 0, multiplication distributes over addition, (4) zero 0 annihilates R, i.e., 0 · R = R · 0 = 0.
In analogy with a similar terminology of ring theory, we call every semiring with 1 a semiring with identity element. A semiring R is called an idempotent semiring, or a dioid, or a semiring with idempotent addition, if x + x = x for x ∈ R.
www.ejgta.org Ideal bases in constructions defined by directed graphs | J. Abawajy, A. V. Kelarev, and J. Ryan Definition 1. Let D be a digraph, and let R be a semiring. Denote by I D (R) the set consisting of zero 0 and all finite sums where all empty sums are assumed to be equal to 0, and where two operations are defined: the standard addition + and the multiplication · defined by the distributive law and the rule for all (g 1 , h 1 ), (g 2 , h 2 ) ∈ E. The set I D (R) with two operations + and · defined above will be called the incidence construction of the digraph D over R. If I D (R) is a semiring, then it is called the incidence semiring of D over R, or the semiring of D over R.
Every digraph D has the incidence construction I D (R) of D over R. However, easy examples show that for some digraphs it is not a semiring (see Proposition 3.1 in the next section). If I D (R) is a semiring, then we say that D has an incidence semiring. Examples of well known and important classes of digraphs that possess incidence semirings are given in the next section.
Incidence semirings of digraphs are a natural generalization of incidence rings (cf. [33, §3.15], [39], [49] and [59]). If R has an identity element 1, then to simplify notation we identify every edge e in E with the element 1e in I D (R).
This paper focuses on ideals in the incidence semiring I D (R) of the digraph D. Let N be the set of all positive integers, and let N 0 = N ∪ {0}. Suppose that T is a subset of I D (R). An ideal generated by T in I D (R) is the set where it is assumed that the identity element 1 of N acts as an identity on the whole I D (R) too. These ideals are also called two-sided ideals, since they are generated by multiplying the elements of the set T from both sides. In contrast, [7] treated different types of ideals called one-sided ideals, or left ideals and right ideals. The weight wt (r) of an element r = n i=1 r i (g i , h i ) ∈ I D (R) is the number of nonzero coefficients r i in the sum. The weight of a subset S of I D (R) is defined as the minimum weight of a nonzero element in S.
The problem of generating ideals with the largest weight was originally motivated by applications to the design of classification systems, also known as classifiers (cf. [61], Section 7.5). Let us refer the readers to a few recent examples of papers in high quality journals devoted to the applications of classifiers in security [1,4,20,38,50] and health informatics [3,5,6,31,37,60]. The role of ideals with largest weight in the design of classifiers is very well explained in [2], where a nice diagram illustrating the classification process is given. More explanations of the role of ideals with largest weight are given, for example, in [8,48]. These explanations and previous work show that it is essential to find ideals with the largest weight in the incidence semirings.

Examples and Open Questions
Since the notion of an incidence semiring has been introduced by the authors only recently, to illustrate the applicability and usefulness of this concept this section presents examples and theoretical results that establish relations between properties of the graph and properties of its incidence semiring. For example, the first proposition of this section shows that the balanced property of the digraph is equivalent to the associative law in the incidence construction over the digraph. The digraph D is said to be balanced if, for all g 1 , g 2 , g 3 , g 4 ∈ V with (g 1 , g 2 ), (g 2 , g 3 ), (g 3 , g 4 ), (g 1 , g 4 ) ∈ E, the following equivalence holds: The following fact is very easy and in the case of rings it is a part of folklore knowledge. Here we include a complete proof for semirings, since this proposition permeates the study of incidence semirings of digraphs. Proof. The 'if' part. Suppose that D is balanced. The distributive law shows that it suffices to verify the associative law for elements x, y, z ∈ I D (R) of the form x = (g 1 , g 2 ), y = (g 2 , g 3 ), z = (g 3 , g 4 ), where g 1 , g 2 , g 3 , g 4 ∈ V , because an arbitrary element of I D (R) is a linear combination of elements of this form.
The 'only if' part. Suppose to the contrary that the associative law is satisfied in I D (R), but D is not balanced. Without loss of generality we may assume that there exist g 1 , g 2 , g 3 , g 4 ∈ V such that (g 1 , g 2 ), (g 2 , g 3 ), (g 3 , g 4 ), (g 1 , g 4 ) ∈ E and (g 1 , g 3 ) ∈ E, but (g 2 , g 4 ) / ∈ E. Then it follows from (1) that x(yz) = (g 1 , g 4 ) and (xy)z = 0. This contradicts the associative law and shows that D must be balanced. This completes the proof.
It follows immediately from (1) and Proposition 3.1 that many natural and well known classes of graphs have incidence semirings.
Example 3.1. The incidence construction is a semiring for each of the following digraphs: (a) complete digraph, (b) null digraph, (c) directed cycle, (d) Petersen digraph.
A semiring R is said to be nilpotent if there exists a positive integer n such that x 1 · · · x n = 0 for all x 1 , . . . , x n ∈ R. Proof. The 'if' part. Assuming that E does not contain any loops, suppose to the contrary that I D (R) is not nilpotent. Put n = |V |. Then there exists a nonzero product (u 1 , u 2 ) · · · (u n , u n+1 ) = (u 1 , u n+1 ) = 0 in I D (R), where (u 1 , u 2 ), (u 2 , u 3 ), . . . , (u n , u n+1 ) in E. However, since |V | = n, it follows that there exist 1 ≤ i < j ≤ n + 1 such that This contradiction shows that I D (R) has to be nilpotent.
The 'only if' part. Suppose to the contrary that I D (R) is nilpotent, but E contains a loop (u, u). It follows from (1) that for any n ∈ N the product of n copies of (u, u) is equal to (u, u), and so it is nonzero. This contradicts the nilpotency of I D (R) and completes the proof.
Examples and theoretical results of this sort confirm that the general problem of investigating the relations of properties of digraphs and properties of their incidence semirings is worth considering. Furthermore, here we include a few open questions concerning a few more advanced properties well known in graph theory. Let us start with the Moore digraphs. A Moore digraph is a digraph that meets the directed Moore bound. Let us refer to the survey [21] and articles [15,16,17,18,19] for more information and previous results on the Moore digraphs. Another important and well known class of digraphs is that of digraphs with edge antimagic labelling (cf. the survey [10], book [14] and papers [11,12]).

Problem 2. Find a semiring property such that the incidence semiring I D (R) satisfies it if and only if D has an edge antimagic labelling.
The readers are referred to [25,26,41,42,43,44] for more information on power graphs. Let us refer to [24,32,35,36,40,45,51,55] for more complete bibliography and background information on the Cayley graphs.

Main Theorem
The following definition was introduced in [29] by analogy to a similar concept of ring theory considered, for example, in [49].
Definition 2. A subset S of a semiring R is called a visible basis for ideals, or a visible ideal basis if, for every subset T of S, the weight of the ideal id (T ) generated by T in R is equal to the minimum of the weights of all elements of T .
Visible ideal bases are convenient for determining the weights of ideals. Let D = (V, E) be a digraph, and let g be a vertex in V . We use the following notation for two sets of vertices Define two sets of edges of the digraph D = (V, E) Denote the subgraph of D = (V, E) with the same set V of vertices and the set E ℓ of edges by Likewise, denote the subgraph of D = (V, E) with the same set V of vertices and the set E r of edges by For any positive integer k, let P k stand for the set of all pairs (S, v), where v ∈ V and S ⊆ In (v) are such that |S| = k, (u, v) ∈ E ℓ for all u ∈ S, and the intersection Out (v) ∩ Out (u) is equal to the same set for all vertices u in S (so that Out (v) ∩ Out (u 1 ) = Out (v) ∩ Out (u 2 ), for all u 1 , u 2 ∈ S). Thus, Let H L,k be the set of all elements x = u∈S r(u, v) ∈ I D ℓ (R), for all pairs (S, v) ∈ P k and all 0 = r ∈ R, i.e., Denote by M L the largest positive integer such that the set P M L is not empty, or zero if such integers do not exist, and put Similarly, for any positive integer k, let us introduce the sets Denote by M R the largest positive integer such that the set Q M R is not empty, or zero if such integers do not exist, and put Let H Z be the set of all elements x = (u,v)∈E ℓ ∩Er r(u, v) ∈ I D (R) for all (u, v) ∈ E ℓ ∩ E r and 0 = r ∈ R. Finally, put Our main theorem shows that all incidence semirings of digraphs have convenient visible bases, which can be used to generate two-sided ideals of the largest weight.  It is nice that our main theorem eliminates algorithmic questions from the problem of generating ideals of the largest weight, because it gives us visible bases which can be used directly to generate ideals of the largest weight.

Proofs
A semiring F is said to be zerosumfree if, for all x 1 , . . . , x n ∈ F , The following lemma is easy and well known. For any semiring R, the left annihilator of R is the set and the right annihilator of R is the set Lemma 5.2. If D is a balanced digraph and R is a semiring with identity element, then the following equalities hold: Proof. Here we include only the proof of equality (19), because the proof of equality (20) is dual. Let us first prove the inclusion Ann r (I D (R)) ⊇ I D ℓ (R). Pick any nonzero element x in I D ℓ (R). By (7), the element x can be written down in the form To verify this, suppose to the contrary that there exists an edge (u, v) ∈ E such that (u, v)x = 0. Then (u, v)(g i , h i ) = 0, for some i. It follows from (1) that v = g i and (u, h i ) ∈ E. Hence u ∈ In (g i ) ∩ In (h i ), and so (g i , h i ) / ∈ E ℓ . This contradiction shows that the assumption made in the beginning of this paragraph was wrong, and in fact I D (R)x = 0. This means that x ∈ Ann r (I D (R)). Thus, Ann r (I D (R)) ⊇ I D ℓ (R).
To prove the reversed inclusion, take any element x in Ann r (I D (R)). We can write it down as Suppose to the contrary that x does not belong to I D ℓ (R). It follows from (7) that there exists i such that (g i , h i ) / ∈ E ℓ . Hence (6) yields that there exists w ∈ V such that (w, with coefficient x i and since x was chosen in the right annihilator Ann r (I D (R)) we get (w, g i )x = 0; whence x i = 0. This contradiction shows that our assumption made in the beginning of this paragraph was wrong, and in fact x ∈ I D ℓ (R). Therefore Ann r (I D (R)) ⊆ I D ℓ (R). This completes the proof of equality (19).

Lemma 5.3. If D is a balanced digraph, R is an idempotent semiring with identity element, and x ∈ H Z , then {x} is a visible ideal basis in I D (R).
Proof. Since x belongs to H Z , we can write it down as a sum where 0 = r ∈ R. Evidently, wt (x) = |E ℓ ∩ E r |. Consider an arbitrary nonzero element y in id (x). It follows from (2) that for some ℓ j , r j ∈ I D (R) ∪ {1}. Lemma 5.2 shows that all summands ℓ j xr j in (22) are equal to zero whenever ℓ j ∈ I D (R) or r j ∈ I D (R). We may assume that only nonzero summands are included in (22). This means that ℓ j = r j = 1 for all j = 1, . . . , k. Since R is an idempotent semiring, it follows from Lemma 5.1 that Therefore wt ( id (x)) = wt (x), which means that {x} is a visible ideal basis in I D (R). Proof. Since x belongs to H L,k , it can be recorded as a sum where (S, v) ∈ P k and 0 = r ∈ R. Hence wt (x) = |S| = k. We need to prove that wt ( id (x)) = wt (x). Pick any nonzero element y in id (x). We have to verify that wt (y) ≥ wt (x). It follows from (2) that y can be written down as for some ℓ j , r j ∈ I D (R) ∪ {1}. We may assume that only nonzero summands ℓ j xr j are included in (25). It follows from x ∈ I D ℓ (R) and Lemma 5.2 that ℓ j x = 0 for all ℓ j ∈ I D (R). Therefore further we may assume that all the ℓ j are equal to 1 in the expression (25).
Since I D (R) = (u,w)∈E R(u, w), in view of the distributive law we may assume that every element r j = 1 in (22) is homogeneous, which means that it belongs to the union ∪ (u,w)∈E R(u, w). Furthermore, since xr j = 0, it follows from (1) that all the r j in (25) where the element v is associated to x in (24). By (9), the intersection Out (v) ∩ Out (u) is equal to one and the same set T for all u in S. Since xr j = 0, we see that all the r j belong to ∪ w∈T R(v, w). Therefore r j = t j (v, w j ), for some 0 = t j ∈ R and w j ∈ V . Since xr j = 0, we get xr j = s∈S rt j (s, w j ). Hence wt (xr j ) = wt (x). Given that R is an idempotent semiring, it follows from Lemma 5.1 that wt (y) ≥ wt (x), as required. Proof. The 'only if' part follows immediately, because the definition of a visible ideal basis implies that every subset S of each visible ideal basis T is a visible ideal basis too.
To prove the 'if' part, suppose that all sets {x} are visible ideal bases in I D (R), for all x ∈ B. Choose an arbitrary subset T of B D (R) and consider a nonzero element y in id (T ) such that the weight of y is minimal, so that wt (y) = wt ( id (T )). By (2), we can write y down as a sum for some t i ∈ T , k ∈ N 0 , ℓ i , r i ∈ I D (R) ∪ N. Combining similar terms in (26) by collecting all summands ℓ i t i r i with equal values of the t i ∈ T into separate subsums, we can rewrite y as where t i ∈ T , ℓ i,j , r i,j ∈ I D (R) ∪ N, and where t i = t j for all 0 ≤ i < j ≤ a. We may remove all sums equal to zero from (27) and assume that b i j=1 ℓ i,j t i r i,j = 0 for all i. Lemmas 5.3, 5.4 and 5.5 This means that the set T is a visible ideal basis of I D (R), which completes the proof.
Proof of Theorem 4.1. Condition (i) immediately follows from (15) and Lemmas 5.3, 5.4, 5.5 and 5.6. Next, we are going to prove condition (ii). Suppose that the incidence semiring I D (R) has an ideal of weight greater than one. Choose an ideal J of I D (R) such that the weight of J is the largest possible one among the weights of all ideals in I D (R). Choose a nonzero element y of minimal weight in J. Then wt (y) = wt (J) ≥ 2. Since y ∈ I D (R), there exist n ≥ 2, y 1 , . . . , y n ∈ R, (g 1 , h 1 ), . . . , (g n , h n ) ∈ E, such that We may assume that likely terms in (28) have been combined so that all edges (g 1 , h 1 ), . . . , (g n , h n ) are pairwise distinct. Then wt (y) = n. Here we have to consider several cases. Case 1. (g 1 , h 1 ), . . . , (g n , h n ) ∈ E ℓ ∩ E r . Then |E ℓ ∩ E r | ≥ wt (y) ≥ 2. Hence the set H Z is nonempty. Take any nonzero element x ∈ H Z . Lemma 5.3 tells us that wt (x) = wt ( id (x)) = |E ℓ ∩ E r |. Hence wt (y) ≤ wt (x). It follows from the maximality of the weight of wt (J) = wt (y) that wt (y) = wt (x). This means that condition (ii) is satisfied in this case.
Case 2. (g 1 , h 1 ), . . . , (g n , h n ) ∈ E r , but there exists i such that (g i , h i ) / ∈ E ℓ . Without loss of generality we may assume that (g 1 , h 1 ) / ∈ E ℓ . By (6), there exists v ∈ In (g 1 ) ∩ In (h 1 ). Fix any j such that 1 ≤ j ≤ n. Consider an arbitrary element w ∈ In (g j ) ∩ In (h j ). We get (w, g j )y = 0, because y j (w, h j ) = 1(w, g j ) · y j (g j , h j ) is a summand of (w, g j )y. Since (w, g 1 )y ∈ id (y) ⊆ J, the minimality of the weight of y in J implies that wt ((w, g j )y) ≥ wt (y). However, (28) yields us that (w, g j )y = n i=1 y i (w, g j )(g i , h i ), and so wt ((w, g j )y) ≤ n = wt (y). Hence wt ((w, g j )y) = wt (y). It follows that all summands y j (w, g j )(g j , h i ) are nonzero. By (1), we get g j = g i for all i = 1, . . . , n. Therefore g 1 = g 2 = · · · = g n , for all j = 1, . . . , n. Since all summands y j (w, g 1 )(g 1 , h i ) in (29) are nonzero, we get w ∈ In (g 1 ) ∩ In (h 1 ). It follows that In (g j ) ∩ In (h j ) = In (g 1 ) ∩ In (h 1 ), for all j = 1, . . . , n. Putting S = {h 1 , . . . , h n }, we get S ⊆ Out (g 1 ). The hypothesis of Case 2 tells us that (g 1 , u) ∈ E r for all u ∈ S. Besides, as we have just verified in the preceding paragraph, the intersection In (g 1 ) ∩ In (u) is equal to one and the same set for all vertices u in S. Therefore (g 1 , S) ∈ Q n .
It follows from (13) that the element belongs to H R,n . Lemma 5.5 tells us that the set {z} is a visible ideal basis in I D (R). Hence wt ( id (z)) = wt (z) = n. The maximality of the weight wt (J) and Lemma 5.5 imply that n = M R . Therefore z ∈ H R . This means that condition (ii) holds true in this case. Case 3. (g 1 , h 1 ), . . . , (g n , h n ) ∈ E ℓ , but there exists 1 ≤ i ≤ n such that (g i , h i ) / ∈ E r . This case is dual to Case 2, and so a dual proof shows that condition (ii) holds true in this case too.