Next Article in Journal
A Theory of Functional Connections-Based hp-Adaptive Mesh Refinement Algorithm for Solving Hypersensitive Two-Point Boundary-Value Problems
Previous Article in Journal
Analysis of High-Order Bright–Dark Rogue Waves in (2+1)-D Variable-Coefficient Zakharov Equation via Self-Similar and Darboux Transformations
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Extending Undirected Graph Techniques to Directed Graphs via Category Theory

by
Sebastian Pardo-Guerra
1,2,†,
Vivek Kurien George
1,2,†,
Vikash Morar
1,2,†,
Joshua Roldan
1,2,† and
Gabriel Alex Silva
1,2,3,*
1
Department of Bioengineering, University of California San Diego, La Jolla, CA 92037, USA
2
Center for Engineered Natural Intelligence, University of California San Diego, La Jolla, CA 92037, USA
3
Department of Neurosciences, University of California San Diego, La Jolla, CA 92037, USA
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Mathematics 2024, 12(9), 1357; https://doi.org/10.3390/math12091357
Submission received: 9 April 2024 / Revised: 28 April 2024 / Accepted: 28 April 2024 / Published: 29 April 2024

Abstract

:
We use Category Theory to construct a ‘bridge’ relating directed graphs with undirected graphs, such that the notion of direction is preserved. Specifically, we provide an isomorphism between the category of simple directed graphs and a category we call ‘prime graphs category’; this has as objects labeled undirected bipartite graphs (which we call prime graphs), and as morphisms undirected graph morphisms that preserve the labeling (which we call prime graph morphisms). This theoretical bridge allows us to extend undirected graph techniques to directed graphs by converting the directed graphs into prime graphs. To give a proof of concept, we show that our construction preserves topological features when applied to the problems of network alignment and spectral graph clustering.

1. Introduction

Networks naturally arise in many real-world situations. Examples vary from macro-structures, such as social networks [1] and economic trade networks [2], to microscopic structures involving protein–protein interactions [3], transcriptional regulation networks [4], gene regulatory networks [5], and both biological and artificial neural networks [6,7]. While real-world networks are often modeled as directed graphs, their computational analysis is not only challenging but far more cumbersome and restricted. Thus, it would be helpful to analyze and solve certain classes of problems for directed graphs from an undirected graph framework. Here, we tackle this problem by using notions and principles of Category Theory (CT) within a graph context. Put simply, CT studies abstract structures and their relations. These structures, or categories, are composed of a collection of things we called “objects”, and a collection of relations between two objects that we call “morphisms”. Originally, CT developed within pure mathematics; much more recently, it started to be used broadly across the natural sciences and engineering, including applications in machine learning and artificial neural networks [8], biological networks [9,10], and social networks [11].
The way we bridge a directed graph framework with an undirected one is by first considering a category of undirected graphs that encode the notion of direction. This category, which we call the prime graphs category, has as objects undirected graphs equipped by a ‘prime labeling’, and as morphisms undirected graphs morphisms that preserve the prime labeling. Indeed, it is the prime labeling that provides a notion of direction over the structure of the undirected graph, allowing us to define a unique direction when transforming to a directed graph, and vice versa. With this in mind, we construct a bijective functor that relates the category of simple directed graphs with the category of prime graphs, such that the notion of direction is preserved. It is worth mentioning that one can always relate a directed graph to an undirected graph in a trivial way: by simply considering the underlying structure and ‘forgetting’ the direction. This correspondence gives rise to a ’forgetful’ functor which is not invertible. In [12], Miller provides one of the first nontrivial transformations between simple directed graphs and undirected graphs by the construction of “gadgets”. These gadgets are used to encode the notion of direction, just as our prime label does. However, each gadget adds seven nodes to the corresponding undirected graphs, while in our framework, we are just adding a prime label node. Additionally, we are the first to address the problem of converting directed graph morphisms into undirected graphs, while preserving the notion of direction. This latter aspect is crucial for both of our applications; in network alignment, the labeling and its preservation through prime graph morphisms ensures the mapping between appropriate nodes through the node similarity metric, while in spectral graph clustering, the labeling plays a role in determining edge weights.
Network alignment is a technique that allows us to compare two networks. This is performed by “putting one on top of the other” in such a way that the structure—or topology—between the networks being compared is preserved as much as possible, and the similarity between the networks is quantified. To date, several network alignment tools exist for undirected networks (see [13,14,15,16]), but to the best of our knowledge, none exist for directed graphs. Our framework, hence, proposes to perform network alignment on directed graphs via their corresponding prime graphs (which are undirected). Within this line of applications, we show the efficacy of our approach empirically by using synthetically generated pairs of networks whose pairwise similarity is known and controlled by the graph generator’s pairwise correlation coefficient. Our results in Section 3.1.1 show that there is a strong statistical correspondence between the generated networks and their resulting pairwise network similarity scores.
Spectral clustering is a widely used and robust technique that considers the spectrum—or eigenvalues and eigenvectors—of the graph Laplacian matrix to partition the nodes of a graph into clusters. More precisely, one can cluster the nodes of a graph by sorting the components of the eigenvector corresponding to the second-smallest eigenvalue of the characteristic polynomial of the graph Laplacian matrix. Initially, spectral clustering was developed for undirected graphs using their adjacency and Laplacian matrices [17]. Later, the technique was extended to directed graphs [18], where a transition probability matrix—or random walk—is used to overcome the asymmetry found in their adjacency and Laplacian matrices. There are heuristic techniques that circumvent the latter construction by making the adjacency matrix of a directed graph symmetric; therefore, they can define a symmetric graph Laplacian matrix [19], which they then use to find the cuts of the directed graph. However, while they are able to show empirically that the resulting cuts are the same, they do not prove equivalence, as we do. Precisely, we prove that our framework preserves minimum cuts, and consequently, it preserves clusters in directed graphs and their respective prime graph counterparts.
The paper is organized as follows. Section 2 gives preliminary notions about directed and undirected graphs from a category theory perspective. We describe the category of prime graphs and prime graph morphisms. We also present the concepts and theoretical results used in the application of our framework. In Section 3, we discuss the applications of network alignment and spectral clustering for directed graphs via functoriality. Finally, Section 4 gives some concluding arguments.

2. Methods

Mathematically, a graph  G = ( V , E ) is a structure that consist of a set of vertices V (nodes) and a set E V × V , which we call edges (connections). Within this context, we say that a graph is undirected if its set of edges are connections without directionality. A graph is directed if all its edges are connections with a direction. Now, given an undirected graph, we represent an edge between the nodes u and v by the unordered pair ( u , v ) , equivalently ( v , u ) . Instead, for a directed graph, an edge from node u to node v is represented by the ordered pair ( u , v ) ; conceptually, we can think of this edge as an arrow with initial node u and terminal node v. Also, we say that the nodes u and v are neighbors if there is at least one edge connecting nodes u and v. Throughout this work, we will consider simple directed graphs, this is, directed graphs with no multiple edges and no self loops.
Intuitively, a graph morphism is a function between the vertex sets that preserves the structure or topology of the graphs; this is, it preserves the edges under transformation:
Definition 1.
Let G 1 = ( V 1 , E 1 ) and G 2 = ( V 2 , E 2 ) be two undirected graphs. An undirected graph morphism is a function f : V 1 V 2 that maps adjacent vertices in G 1 into adjacent vertices in G 2 . Algebraically, this means that for any pair of vertices u , v V 1 with ( u , v ) E 1 , we have ( f ( u ) , f ( v ) ) E 2 .
For two directed graphs G 1 and G 2 , we say that a function V 1 f V 2 is a directed graph morphism if f maps initial nodes into initial nodes, and terminal nodes into terminal nodes. One can verify that the composition of two graph morphism always yields another graph morphism, in both undirected and directed cases. Further, the composition is an associative operation that has a neutral element, called the identity morphism (which coincides with the identity map). With this in mind, one can show that the collection of all undirected graphs and all undirected graph morphisms ( UndGraph ) forms a category. Similarly, the collection of all simple directed graphs and all directed graph morphisms ( DGraph ) forms a category. As we see next, the category DGraph is isomorphic to a subcategory of UndGraph ; this subcategory, in fact, is the category of prime graphs ( PGraph ) that we define.
Before describing the isomorphism between DGraph and PGraph , we will detail the category of prime graphs and its connection to simple directed graphs. Conceptually, a prime graph is an undirected graph which admits a ’prime labeling’ on its set of nodes (Figure 1). By allowing a “prime labeling”, we mean that there exists a labeling function on the vertex set with the following two properties; any prime labeled node has only non-prime labeled nodes as neighbors (and vice versa), and any prime labeled node is always adjacent to its non-prime labeled counterpart node.
Definition 2.
Let G u = V u , E u be an undirected graph with 2 n vertices, and let I = { a 1 , a 2 , , a n } . We say that G u admits a prime labeling if there exists a bijective function φ : V u I I such that for v V u , one has the following three cases:
(i)
If φ ( v ) = i and i I , then for each neighbor u of v, φ ( u ) = k for some k I . We visualize this as
Mathematics 12 01357 i001
(ii)
If φ ( v ) = i and i I , then for each neighbor u of v, φ ( u ) = k for some k I . We visualize this as
Mathematics 12 01357 i002
(iii)
For each v V u , if φ ( v ) = i and i I , then there exists u V u a neighbor of v such that φ ( u ) = i and i I .
For illustrative purposes, consider the following graphs:
Mathematics 12 01357 i003
The graph on the left is not a prime graph, as the prime labeled nodes are connected to each other. For the same reasons, the graph on the right is not a prime graph; however, this last graph becomes a prime graph if we endow it with the following prime labeling:
Mathematics 12 01357 i004
We also observe that one can visualize a prime graph as an undirected bipartite graph. This is a consequence of the definition of a prime labeling, as prime labeled node only have non-prime labeled nodes as neighbors, and vice versa. Please see in Figure 2.
Now, due to condition ( i i i ) , we can naturally induce a directed graph from a prime graph. In this case, the direction of an arrow will be given by the ’prime’ label vertex. For instance, if we consider the linear undirected graph G
Mathematics 12 01357 i005
we can give the prime labeling
Mathematics 12 01357 i006
which induces the directed graph
Mathematics 12 01357 i007
having a directed edge from an initial vertex w i to a terminal vertex w j .
In terms of morphisms, we can think of a prime graph morphism as an undirected graph morphism that preserves the prime and non-prime labelings. Formally:
Definition 3.
Let G u 1 and G u 2 be two prime graphs, with labeling functions φ I 1 and φ I 2 , respectively. A prime graph morphism is an undirected graph morphism f : V u 1 V u 2 that satisfies the following conditions:
(i)
(Non-prime label preservation) If v V u 1 with φ I 1 ( v ) = i for some i I 1 , then f ( v ) V u 2 is such that
φ I 2 ( f ( v ) ) = j
for j I 2 I 2 I 2 .
(ii)
(Prime label preservation) If w V u 1 with φ I 1 ( w ) = i for some i I 1 , then f ( w ) V u 2 is such that
φ I 2 ( f ( w ) ) = j
for j I 2 I 2 I 2 .
(iii)
If v , w V u 1 are adjacent vertices with φ I 1 ( v ) = k and φ I 1 ( w ) = k , then one always has that
φ I 2 ( f ( w ) ) = φ I 2 ( f ( v ) ) .
The above can be rephrased by saying that a prime graph morphism is an undirected graph morphism compatible with the non-prime and prime labelings. From an algebraic perspective, this compatibility condition means that, for each prime graph morphism f : V u 1 V u 2 , there exists a function f I : I 1 I 1 I 2 I 2 making
Mathematics 12 01357 i008
a commutative diagram; that is, f I φ I 1 = φ I 2 f .
Furthermore, the composition of two prime graph morphisms results in a prime graph morphism itself. This follows from the fact that the composition of undirected graph morphisms is a closed operation, and also from the fact that the composition of prime graph morphisms preserves the prime and non-prime labeling conditions. Expressed in diagrams, this latter aspect is equivalent to saying that the commutativity of the large diagram is a consequence of the commutativity of the smaller diagrams:
Mathematics 12 01357 i009
Additionally, as the composition operation of undirected graph morphisms is an associative operation, it follows that the composition of prime graph morphisms is also an associative operation. Further, for any prime graph G u , its identity prime graph morphism coincides with the identity map defined on the undirected graph G u . Considering the above, one has that the collection of prime graphs, along with the collection of prime graph morphisms, form a category.
Theorem 1.
The collection of all prime graphs, and all prime graph morphisms, defines a category denoted by PGraph.
It is worth noting that not every undirected graph morphism induces a prime graph morphism. To see this, let us consider the following prime graphs:
Mathematics 12 01357 i010
Then, the function with correspondence rule x a , x a , y c , y b , z b , and z a is an undirected graph morphism which is not a prime graph morphism. In fact, this illustrates that the category PGraph is not a full subcategory of UndGraph. Consequently, both the graph isomorphism problem and the subgraph isomorphism problem for prime graphs differentiates that for undirected graphs, which are known to be open and NP-complete, respectively.

2.1. DGraph and PGraph Are Isomorphic Categories

The first part of this subsection describes the functors L : DGraph PGraph and M : PGraph DGraph . The second part of this subsection shows that L and M are inverse of each other.

2.1.1. The Functors L and M

The following two propositions describe the assignment on objects and morphisms of functor L : DGraph PGraph :
Proposition 1.
Let G d be a directed graph in DGraph . Then, G d induces a prime graph G u in PGraph .
Proof of Proposition 1.
Let G d = ( V d , E d ) be a finite directed graph in DGraph. Without loss of generality, let us suppose that V d is represented by the set { v 1 , v 2 , , v n } . Thus, by denoting v i = v i for each i { 1 , , n } , the prime graph G u has vertex set
V u : = { v 1 , v 2 , , v n , v 1 , v 2 , , v n } .
Now, to define the edge set E u , we will consider the following two cases:
(i)
for each i { 1 , , n } , the tuple ( v i , v i ) defines an edge in G u ;
(ii)
for i j in { 1 , , n } , we have that ( v i , v j ) defines an edge in G u if, and only if, there exists a directed edge ( v i , v j ) E d .
In other words,
E u = ( v i , v j ) if i j and ( v i , v j ) E d ( v i , v i ) for each i { 1 , , n } .
We claim that G u admits an I-labeling. Let I = { 1 , 2 , , n } and I = { 1 , 2 , , n } be the non-prime and prime sets, respectively. We define the labeling function V u φ I I as follows. For each v V u ,
φ ( v ) = i if v = v i with v i { v 1 , v 2 , , v n } i if v = v i with v i { v 1 , v 2 , , v n }
Clearly, φ is a bijective function. Moreover, based on how G u is defined, condition ( i i i ) of Definition 2 is satisfied. Thus, it suffices to show that G u equipped by φ satisfies conditions ( i ) and ( i i ) . Now, if v V u is such that φ ( v ) = i , then v = v i for i I . Hence, as the incident edges to vertex v i V u have the form ( v i , v j ) —that is, when ( v i , v j ) E d —or ( v i , v i ) , it follows that the neighbors of v i also have the form v j , with j i , or v i . In any case, one has that φ ( v j ) = j for any possible neighbor v j of v. Likewise, if φ ( v ) = i for some i I , then v = v i . Again, based on how the undirected graph G u is defined, one has that the incident edges to vertex v i in G u are either of the form ( v j , v i ) (namely, when ( v j , v i ) E d ) or ( v i , v i ) . Thus, the neighbors of v i can be either v j (for some j i ) or v i , which in turn implies that φ ( v j ) = j for any possible neighbor v j of v. Therefore, φ defines a prime labeling function on G u . □
Figure 3 displays the correspondence between a directed graph G d and its corresponding prime graph G u . Notice that the prime labeled nodes encode for the notion of incoming edges of the corresponding directed graph.
Proposition 2.
Let G d 1 and G d 2 be two directed graphs inDGraph, and let V d 1 f V d 2 be a directed graph morphism. Then, f induces a prime graph morphism f ¯ between the prime graphs G u 1 and G u 2 .
Proof of Proposition 2.
Let G d 1 , G d 2 DGraph , and let us take f : V d 1 V d 2 , a directed graph morphism. Without loss of generality, assume that the vertex sets are V d 1 = { v 1 , v 2 , , v n } and V d 2 = { w 1 , w 2 , , w m } , respectively. Then, by Proposition 1, the vertex set of the corresponding prime graphs G u 1 and G u 2 are given by
V u 1 = { v 1 , v 2 , , v n , v 1 , v 2 , , v n }
and
V u 2 = { w 1 , w 2 , , w m , w 1 , w 2 , , w n } ,
respectively. With this in mind, we define f ¯ : V u 1 V u 2 by
f ¯ = f ¯ ( v i ) = f ( v i ) for v i { v 1 , v 2 , , v n } f ¯ ( v i ) = f ( v i ) for v i { v 1 , v 2 , , v n } ,
where f ( v i ) = w k is the prime labeled vertex in V u 2 such that f ( v i ) = w k . We claim that f ¯ is a prime graph morphism. Indeed, for any edge ( v i , v j ) E u 1 , with i j , it corresponds to a directed edge ( v i , v j ) in E d 1 . Thus, as f preserves adjacencies—in the directed case—we have that ( f ( v i ) , f ( v j ) ) E d 2 , which in turn implies that ( f ( v i ) , f ( v j ) ) E u 2 . Considering this, one has that
f ¯ ( v i , v j ) = f ¯ ( v i ) , f ¯ ( v j ) = f ( v i ) , f ( v j ) E u 2 .
Moreover, for edges of the form ( v i , v i ) E u 1 , one obtains
f ¯ ( v i , v i ) = f ¯ ( v i ) , f ¯ ( v i ) = f ( v i ) , f ( v i ) E u 2 .
Thus, f ¯ preserves adjacencies. Now, based on how f ¯ is defined, it is clear that f ¯ is compatible with the labeling, as it preserves the prime and non-prime labelings: f ¯ ( v i ) = f ( v i ) = f ¯ ( v i ) . Therefore, f ¯ is a prime graph morphism. □
To better visualize Proposition 2, let us consider a directed graph morphism f that maps a directed edge ( v i , v k ) E d 1 into a directed edge ( f ( v i ) , f ( v k ) ) E d 2 :
Mathematics 12 01357 i011
Then, in the prime graph context, one has a prime graph morphism f ¯ mapping
Mathematics 12 01357 i012
Remark 1.
If G d = ( V d , E d ) is a directed graph, then its corresponding prime graph G u = ( V u , E u ) satisfies that
| E u | = | E d | + | V d | .
This follows from the fact that an edge in G u has either the form ( v i , v j ) —corresponding to a directed edge ( v i , v j ) in G d —or the form ( v i , v i ) .
Considering the results from above, we have the following:
Theorem 2.
The map L : DGraph PGraph that assigns to each object G d DGraph the object G u PGraph and to each morphism f DGraph the morphism f ¯ PGraph defines a functor from DGraph to PGraph.
Proof Theorem 2.
Observe that the object and morphism assignments of functor L : DGraph PGraph are exactly Proposition 1 and Proposition 2, respectively. Thus, it suffices to show that L preserves identity morphisms and composition of morphisms.
The fact that L preserves identity morphisms follows from Proposition 2 as I d ¯ coincides with the identity map I d . To see that L preserves compositions, we will show that, given the directed graph morphisms f : V d 1 V d 2 and g : V d 2 V d 3 , one has that g f ¯ = g ¯ f ¯ . Following the notation so far, we will denote the vertex set of the directed graph G d 1 by V d 1 = { v 1 , v 2 , , v n } , the vertex set of the directed graph G d 2 by V d 2 = { w 1 , w 2 , , w m } , and the vertex set of the directed graph G d 3 by V d 3 = { z 1 , z 2 , , z l } . Then, by Proposition 10, the vertex sets of their corresponding prime graphs are given by
V u 1 = { v 1 , v 2 , , v n , v 1 , v 2 , , v n } , V u 2 = { w 1 , w 2 , , w m , w 1 , w 2 , , w m } , a n d   V u 3 = { z 1 , z 2 , , z l , z 1 , z 2 , , z l } ,
respectively.
Now, on the one hand, the image under functor L of the directed graph morphism defined by the composition ( g f ) is the prime graph morphism ( g f ) ¯ : V u 1 V u 3 , whose correspondence rule is given by
( g f ) ¯ = ( g f ) ¯ ( v i ) = ( g f ) ( v i ) for v i { v 1 , v 2 , , v n } ( g f ) ¯ ( v i ) = ( g f ) ( v i ) for v i { v 1 , v 2 , , v n } .
Here, ( g f ) ( v i ) = z r denotes the prime labeled vertex on V d 3 such that ( g f ) ( v i ) = z r .
On the other hand, the image of f under L is the prime graph morphism f ¯ : V u 1 V u 2 given by
f ¯ = f ¯ ( v i ) = f ( v i ) for v i { v 1 , v 2 , , v n } f ¯ ( v i ) = f ( v i ) for v i { v 1 , v 2 , , v n } ,
while the image of g under L is the prime graph morphism g ¯ : V u 2 V u 3 given by
g ¯ = g ¯ ( w i ) = f ( w i ) for w i { w 1 , w 2 , , w m } g ¯ ( w i ) = f ( w i ) for w i { w 1 , w 2 , , w m } .
Note that, as prime graph morphisms preserve the prime vertex and non-prime vertex labelings, one then has that f ¯ ( v i ) { w 1 , , w m } and f ¯ ( v i ) { w 1 , , w m } . This way, when considering the composite morphism g ¯ f ¯ : V u 1 V u 3 , one has that, for each v i { v 1 , v 2 , , v n } ,
( g ¯ f ¯ ) ( v i ) = g ¯ ( f ¯ ( v i ) ) = g ¯ ( f ( v i ) ) = g ( f ( v i ) ) = ( g f ) ( v i ) = ( g f ) ¯ ( v i ) ,
whereas for each v i { v 1 , v 2 , , v n } ,
( g ¯ f ¯ ) ( v i ) = g ¯ ( f ¯ ( v i ) ) = g ¯ ( f ( v i ) ) = g ( f ( v i ) ) = ( g f ) ( v i ) = ( g f ) ¯ ( v i ) .
Hence, ( g f ) ¯ and ( g ¯ f ¯ ) have the same correspondence rule, and hence, ( g f ) ¯ = ( g ¯ f ¯ ) . Consequently,
L ( g f ) = ( g f ) ¯ = g ¯ f ¯ = L ( g ) L ( f ) ,
that is, L preserves compositions of morphisms. □
Remark 2.
The functor L preserves topological features. For instance, connectivity is preserved under L . Also, if G d is a complete directed graph, then its corresponding prime graph L ( G d ) is a complete bipartite graph.
On the other end, the next two propositions describe the assignment on objects and morphisms of functor M : PGraph DGraph :
Proposition 3.
Let G u be a prime graph. Then, G u induces a simple directed graph G d .
Proof of Proposition 3.
Let G u be a prime graph, and let φ I : V u I I be its labeling function, with I = { 1 , , n } . If the vertex set of G u is given by
V u = { v 1 , v 2 , , v n , v 1 , v 2 , , v n } ,
then, we define the vertex set of the directed graph G d , induced by G u , as
V d = { v 1 , v 2 , , v n } .
In order to define the edge set E d , we must consider all incident edges to the set of prime label vertices v i in V u . For instance, if v j is adjacent to v i in G u (with j i ), then we will obtain a directed edge in G d from vertex v i towards vertex v j . In case v i is the only adjacent vertex to v i in G u , then the corresponding vertex v i in G d will not have incoming directed edges. In other words, the set E d is given by
E d = ( v i , v j ) whenever i j and ( v i , v j ) E u
Proposition 4.
Let G u 1 , G u 2 PGraph and let g : V u 1 V u 2 be a prime graph morphism. Then, g induces a directed graph morphism g ˜ between their corresponding directed graphs G d 1 and  G d 2 .
Proof of Proposition 4.
Let G u 1 , G u 2 PGraph , and let f : V u 1 V u 2 be a prime graph morphism. Without loss of generality, let us assume that V u 1 = { v 1 , , v n , v 1 , , v n } and V u 2 = { w 1 , , w m , w 1 , , w m } . Then, by Proposition 3, the vertex sets V d 1 and V d 2 are given by { v 1 , , v n } and { w 1 , , w m } , respectively. With this in mind, we define the map f ˜ : V d 1 V d 2 as follows. For each v i V d 1 , we set f ˜ ( v i ) = f ( v i ) . We claim that f ˜ preserves adjacencies. Indeed, given ( v i , v j ) E d 1 , we have that ( v i , v j ) E u 1 ) . Thus, as f is a prime graph morphism, we obtain that ( f ( v i ) , f ( v j ) ) E u 2 . Moreover, since f is compatible with the prime and non-prime labelings, it follows that f ( v j ) = f ( v j ) , from which we have that ( f ( v i ) , f ( v j ) ) E d 2 . Therefore,
f ˜ ( v i , v j ) = ( f ˜ ( v i ) , f ˜ ( v j ) ) = ( f ( v i ) , f ( v j ) ) E d 2 ,
showing that f ˜ is a directed graph morphism. □
Considering the above, we have the following:
Theorem 3.
The map M : PGraph DGraph that assigns to each object G u PGraph the object G d DGraph , and to each morphism f PGraph the morphism f ˜ DGraph is a functor.
Proof of Theorem 3.
By Propositions 3 and 4, it suffices to show that the map M preserves identity morphisms and composition of morphisms.
The fact that M preserves identity morphisms follows from Proposition 4, as I d ˜ coincides with the identity map I d . To see that M preserves compositions, we will prove that, given the prime graph morphisms f : V u 1 V u 2 and g : V u 2 V u 3 , one has that g f ˜ = g ˜ f ˜ . Without loss of generality, let us suppose that
V u 1 = { u 1 , u 2 , , u n , u 1 , u 2 , , u n } , V u 2 = { v 1 , v 2 , , v m , v 1 , v 2 , , v m } a n d V u 3 = { w 1 , w 2 , , w l , w 1 , w 2 , , w l } .
Following along with the notation, we will denote the vertex sets of the directed graphs G d 1 , G d 2 and G d 3 by V d 1 = { u 1 , u 2 , , u n } , V u 2 = { v 1 , v 2 , , v m } and V u 3 = { w 1 , w 2 , , w l } , respectively. Now, on the one hand, the image under M of the prime graph morphism g f is the directed graph morphism ( g f ) ˜ : V d 1 V d 3 , whose correspondence rule is given by
( g f ) ˜ ( u i ) = ( g f ) ( u i ) , u i V d 1 .
On the other hand, the directed graph morphism f ˜ : V d 1 V d 2 is defined by f ˜ ( u i ) = f ( u i ) , for all u i V d 1 . Likewise, the directed graph morphism g ˜ : V d 2 V d 3 is defined by g ˜ ( v j ) = g ( v j ) , for all v j V d 2 . Therefore, the composition ( g ˜ f ˜ ) : V d 1 V d 3 is a directed graph morphism such that, for each vertex u i { u 1 , u 2 , , u n } ,
( g ˜ f ˜ ) ( u i ) = g ˜ ( f ˜ ( u i ) ) = g ˜ ( f ( u i ) ) = g ( f ( u i ) ) = ( g f ) ( u i ) = ( g f ) ˜ ( u i ) .
The above shows that ( g ˜ f ˜ ) and ( g f ) ˜ have the same correspondence rule. Since both functions have the same domain and codomain, we obtain that ( g ˜ f ˜ ) = ( g f ) ˜ . Therefore,
M ( g f ) = ( g f ) ˜ = g ˜ f ˜ = M ( g ) M ( f ) ,
that is, M preserves compositions of morphisms. □

2.1.2. The Functors L and M Are Isomorphisms

Recall that an isomorphism between two categories C and D is a functor T : C D that is a bijection on both objects and morphisms. In other words, a functor T : C D is an isomorphism if, and only if, there exists a functor S : D C for which the compositions T S and S T are the identity functors I d D and I d C , respectively. In this case, we say that the categories C and D are isomorphic.
Proposition 5.
Let G d be a directed graph inDGraph. Then
( M L ) ( G d ) = G d .
Proof of Proposition 5.
Let G d DGraph . Without loss of generality, we can assume that V d = { v 1 , , v n } . Then, the prime graph L ( G d ) = G u has the vertex set
V u = { v 1 , v 2 , , v n , v 1 , v 2 , , v n } ,
and the edge set
E u = ( v i , v j ) if i j and ( v i , v j ) E d ( v i , v i ) for each v i V d .
If we now consider the directed graph induced by G u , that is, M ( G u ) = G d * , then, the vertex set V d * is given by { v 1 , , v n } and its edge by
E d * = ( v i , v j ) i j a n d ( v i , v j ) E u .
In this way, as ( v i , v j ) E u if, and only if, ( v i , v j ) E d , it follows that ( v i , v j ) E d * if, and only if, ( v i , v j ) E d . Moreover, since G d and G d * have the same vertex set { v 1 , v 2 , , v n } , we can conclude that G d = G d * . Therefore,
( M L ) ( G d ) = G d .
Proposition 6.
Let G d 1 , G d 2 DGraph , and let f : V d 1 V d 2 be a directed graph morphism. Then,
( M L ) ( f ) = f .
Proof of Proposition 6.
Let G d 1 and G d 2 be directed graphs, and let f : V d 1 V d 2 be a directed graph morphism. Without loss of generality, assume that V d 1 = { v 1 , , v n } . Then, by Theorem 2, we obtain the prime graphs L ( G d 1 ) = G u 1 and L ( G d 2 ) = G u 2 , along with the prime graph morphism L ( f ) = f ¯ defined by
f ¯ = f ¯ ( v i ) = f ( v i ) for v i { v 1 , v 2 , , v n } f ¯ ( v i ) = f ( v i ) for v i { v 1 , v 2 , , v n } .
Here, V u 1 = { v 1 , v 2 , , v n , v 1 , v 2 , , v n } . Now, as
M ( G u i ) = M ( L ( G d i ) ) = ( M L ) ( G d i ) = G d i ,
for i = 1 , 2 , it suffices to show that the functions M ( f ¯ ) and f have the same correspondence rule, since both have the same domain and codomain sets. By considering M ( f ¯ ) = f ¯ ˜ , we see that f ¯ ˜ ( v i ) = f ¯ ( v i ) = f ( v i ) , for each vertex v i { v 1 , , v n } . Therefore, M ( f ¯ ) = f , and thus,
( M L ) ( f ) = f .
Corollary 1.
The functor L : DGraph PGraph and the functor M : PGraph DGraph satisfy
( M L ) = I d DGraph .
On the other end, we have the following results:
Proposition 7.
Let G u be a prime graph. Then
( L M ) ( G u ) = G u .
Proof of Proposition 7.
Let G u PGraph . Without loss of generality, assume that the vertex set V u is given by the set { v 1 , v 2 , , v n , v 1 , v 2 , , v n } . Then G d = M ( G u ) is the directed graph with vertex set G d = { v 1 , v 2 , , v n } , and edge set
E d = ( v i , v j ) i j a n d ( v i , v j ) E u .
Now, if we denote by G u * the prime graph induced by G d , that is, L ( G d ) = G u * , then, V d * = { v 1 , , v n , v 1 , , v n } , and
E u * = ( v i , v j ) if i j and ( v i , v j ) E d ( v i , v i ) for each v i V d .
Notice that ( v i , v j ) E u * if, and only if, ( v i , v j ) E d , which holds if, and only if, ( v i , v j ) E u . Since both graphs G u and G u * have as vertex set the set { v 1 , v 2 , , v n , v 1 , , v n } , we conclude that G u = G u * . Therefore,
( L M ) ( G u ) = G u .
Proposition 8.
Let f : V u 1 V u 2 be a prime graph morphism. Then
( L M ) ( f ) = f .
Proof of Proposition 8.
Let f : V u 1 V u 2 be a prime graph morphism, and let us suppose that V u 1 = { v 1 , , v n , v 1 , , v n } . By Theorem 3, we have the directed graphs M ( G u 1 ) = G d 1 and M ( G u 2 ) = G d 2 , along with the directed graph morphism M ( f ) = f ˜ : V d 1 V d 2 defined by f ˜ ( v i ) = f ( v i ) , for each i = 1 , , n . Now, as
L ( G d i ) = L ( M ( G u i ) ) = ( L M ) ( G u i ) = G u i
for i = 1 , 2 , it suffices to show that L ( f ˜ ) and f have the same correspondence rule, as these have the same domain and codomain sets. By considering that L ( f ˜ ) = f ˜ ¯ is such that
f ˜ ¯ = f ˜ ¯ ( v i ) = f ˜ ( v i ) = f ( v i ) for v i { v 1 , v 2 , , v n } f ˜ ¯ ( v i ) = f ˜ ( v i ) = f ( v i ) for v i { v 1 , v 2 , , v n } ,
we see that L ( f ˜ ) and f have the same correspondence rule. Thus, L ( f ˜ ) = f , which in turn implies that
( L M ) ( f ) = f .
Corollary 2.
The functor L : DGraph PGraph and the functor M : PGraph DGraph satisfy
( L M ) = I d PGraph .
Therefore, by Corollaries 1 and 2, we have the following:
Theorem 4.
The categories DGraph and PGraph are isomorphic.
We highlight that the property of functoriality on graph morphisms is what allowed us to extend network alignment techniques for undirected graphs to directed graphs. As previously mentioned, an alignment of two networks consists of a mapping between the nodes of the compared networks. In doing this, one aims to preserve as much of the structure (or topology) between the considered networks as possible. Thus, when transforming two directed graphs into their corresponding prime graphs, the way we relate these prime graphs is by defining a prime graph morphism. This prime graph morphism preserves the topology and the labeling conditions, which ultimately gives the notion of direction. Consequently, by functoriality, these prime graph morphisms correspond to the directed graph morphisms used when aligning the compared directed graphs.

2.2. Prime Transformation Algorithm

This section outlines an algorithm (Algorithm 1) to convert a directed graph to a prime graph, reflecting definitions and constructions found in the previous section. Then, we discuss the time and space complexity for creating and storing a prime graph from a directed graph. Note that the algorithm does not consider edge weights because weighting schemes can vary based on application.
The input to Algorithm 1 is a directed graph, and the output is its corresponding prime graph. The algorithm operates on each edge of the directed graph. As such, the algorithm’s time complexity is O ( n + e ) , where e is the number of edges and n is the number of nodes in the directed graph. While additional space is required to store the prime graph, the space necessary scales according to O ( n + e ) . The extra space needed to store a prime graph results from the additional nodes and edges it contains relative to its directed graph counterpart. For prime graphs, the number of nodes is always double that of directed graphs because each node in the directed graph spawns an additional prime node. Additionally, an edge is created between each pair of prime and non-prime nodes; therefore, additional n edges are required.
Algorithm 1 Prime Transformation Algorithm
     Input DGraph
     Output PGraph
 1:
procedure MakePGraph
 2:
     dirEdges DGraph . edges
▹ Initialize edge list
 3:
     dirNodes DGraph . nodes
▹ Initialize node list
 4:
     PGraph Empty Graph
▹ Initialize an empty prime graph
 5:
    for n in dirNodes do:
 6:
         nonPrimeNode n . label
▹ store the label of node n
 7:
         primeNode n . label + p
▹ create a label for the n’s prime node
 8:
         PGraph A d d N o d e ( primeNode )
▹ add prime node
 9:
         PGraph A d d N o d e ( nonPrimeNode )
▹ add non-prime node
10:
        PGraph A d d E d g e ( primeNode , nonPrimeNode )
▹ add an edge between prime and non-prime node pairs
11:
    for e in dirEdges do:
12:
         source e . initial . label
▹ store edge head label
13:
         target e . terminal . label
▹ store edge tail label
14:
         primeNode e . terminal . label + p
▹ store the tail node’s prime label
15:
         PGraph A d d E d g e ( source , primeNode )
▹ add edge to PGraph using labels
16:
         PGraph A d d E d g e ( primeNode , target )
▹ add edge to PGraph using labels
17:
    return PGraph

3. Numerical Results

This section contains the two applications of the isomorphisms between the category of simple directed graphs DGraph and the category of prime graphs PGraph. To perform the computations, we relied on two things: the explicit description of the objects and morphisms of the category PGraph, and the explicit definition of functors L and M .

3.1. Network Alignment

Network alignment is a technique that consists of mapping the nodes of the compared networks in such a way that the structure, or topology, is preserved as much as possible. While mapping the nodes, the alignment looks to maximize node similarity and preserve the edge topology. Network alignment algorithms use an objective function—which is defined over candidate alignments—to find the best possible alignment between network pairs. This objective function represents a score, usually based on node and edge similarity. By considering this score, the aligner follows a “search algorithm" to find the fittest network map that maximizes the objective function. For a deeper understanding of network alignment and its applications, we recommend the reader see [13,14,15].

3.1.1. Synthetic Network Model

To demonstrate the efficacy of our correspondence between directed graphs and prime graphs, we generated a synthetic dataset that allowed us to precisely control the ground truth network similarity by generating correlated graph pairs. In this way, by using a network aligner, we calculated the network similarity scores between pairs of correlated prime graphs that were generated from pairs of correlated directed graphs (where correlation values for each pair were known). Our results indicate that the alignment scores between pairs of prime graphs are closely related to the correlation coefficients used to generate the corresponding directed graphs.
To generate the synthetic dataset, we used a stochastic block model (SBM) network topology [20] with the following parameters and values. The directed network consisted of 150 total nodes, organized into 3 blocks with 50 nodes per block, as well as 10 to 20 percent connection density inter-block and 1 percent intra-block connection density. For each discrete value of graph pair correlation coefficients ρ , we generated 50 pairs of directed graphs. It is the correlation coefficient ρ that determines the similarity between graphs. This way, we first created a directed graph from an edge probability matrix, which is defined by the previously mentioned inter- and intra-block connection density, and then, we use the coefficient ρ to adjust the probability matrix for a second directed graph in the pair. Observe that the closer ρ is to 1, the more similar the probability matrices will be, which means that it is more likely that the two generated graphs will be similar. Our results iterate through discrete values of ρ in the range of [ 0.5 , 1 ] at 0.1 increments.
In summary, after generating all the directed graph pairs, we converted them to prime graphs, ran the network alignment algorithm for each prime graph pair, and plotted the similarity score as a function of ρ using the highest similarity score out of the 5 alignment attempts per pair.

3.1.2. Numerical Result

We used both edge and node similarity scores to optimize network alignments. The optimizer uses a cost function that consists of an equally weighted linear combination of edge and node similarity scores. We used EC, ICS, and S3 edge similarity scores along with a graphlet orbit degree-based node similarity score (see the references [13,14,15,21,22] for details on each score’s definition). Finally, we used SANA [13], an off-the-shelf network aligner, and the aforementioned similarity scores for alignment optimization.
Figure 4 is a box and whisker plot (see [23]), which contains empirical alignment scores for varying values of the graph correlation coefficient. When the graph pairs are perfectly correlated ( ρ = 1 ), that is, they are exact copies, but the mapping between nodes is unknown, the alignment tool finds the perfect mapping between the graphs. As the ρ values decrease, the alignment scores decrease. The variance in the alignment scores primarily results from the network alignment algorithm’s random initialization, stochastic optimization routines, finite number of optimization steps, as well as because the optimization function is not guaranteed to be convex. A secondary source of alignment score variability is from the stochastic graph pair generation process (see Section 3.1.1). Variation in alignment scores results in an R 2 [24] value of 0.98 with a corresponding p-value of 9 × 10 6 . These results indicate that calibrating for the slope yields a usable network alignment metric.

3.2. Minimum Cuts and Spectral Clustering in Prime Graphs

We start by showing the connection between cuts in a directed graph and cuts in its corresponding prime graph. Afterwards, we see that the functorial correspondence preserves clusters. This will allow us to use spectral clustering and show that a weighted prime graph maintains the same minimum cuts as its directed graph counterpart.
Recall that a cut in an undirected graph G u = ( V u , E u ) is a partition of the vertex set V u into a subset S and its complement S ¯ = V u S . Likewise, one defines a cut in a directed graph G d = ( V d , E d ) as a partition of the vertex set V d = S . S ¯ . Now, for each weighted directed graph G d = ( V d , E d ) with weight values given by { w v i , v j } ( v i , v j ) E d , there is a weighted prime graph G u = ( V u , E u ) whose weight values are given as follows. For each edge in G u of the form ( v i , v j ) , we set the weight value w v i , v j equal to ( w v i , v j ) / 2 . For the remaining edges in G u of the form ( v i , v i ) , we give a weight value w v i , v i satisfying
w v i , v i > v k ( v k , v i ) E u w v k , v i 2 .
With this in mind, we have a correspondence between cuts in G d and cuts in G u with lesser volume. Recall that, given a weighted undirected graph G u , we define the volume of a cut ( C , C ¯ ) (where C ¯ = V u C ) as
v o l u ( C ) = x C , y C ¯ w x , y .
Notice that v o l u ( C ) considers those edges whose endpoints belong to different components C and C ¯ . Furthermore, as the graph G u is undirected, it follows that v o l u ( C ) = v o l u ( C ¯ ) . Considering this, for the weighted prime graph G u , with weight values described as above, we have the following:
Proposition 9.
Any cut in the weighted prime graph G u can be reduced to a cut of the form ( S S ) , ( S ¯ S ¯ ) with lower volume. Here, S and S ¯ are subsets that partition the non-prime nodes of V u , and S and S ¯ denote their prime node counterparts, which partition the set of prime nodes of V u .
Proof of Proposition 9.
Suppose that ( C , C ¯ ) is a cut of the prime graph G u such that v i C and v i C ¯ . This implies that the weight of the edge ( v i , v i ) adds to the volume of the cut. Now, if we consider the cut defined by the sets C { v i } and C ¯ { v i } , the weight of the edge ( v i , v i ) will no longer add to the volume of the cut; instead, we will be adding those weights corresponding to the edges that are adjacent to v i , which turns out to be at most
v k ( v k , v i ) E u w v k , v i < w v i , v i .
By continuing with this process, we will obtain a cut of the form ( S S ) , ( S ¯ S ¯ ) , where S and S ¯ are subsets of V u that partition the non-prime vertices, whereas S and S ¯ are their corresponding prime nodes which partition the prime vertices of V u . Note that, by construction, this last cut has lower volume than the initial cut ( C , C ¯ ) . □
The above proposition shows that the cuts with less volume in the weighted prime graph G u are those with form ( S S ) , ( S ¯ S ¯ ) . These cuts, in turn, are clearly in a one-to-one correspondence between cuts of the form ( S , S ¯ ) in the directed graph G d . We now show that the volume of a directed graph G d is preserved when transformed to its corresponding weighted prime graph G u .
Definition 4.
Let G d = ( V d , E d ) be a directed graph. A circulation on G d is a function F : E d R + { 0 } that assigns each directed edge to a non-negative value such that
u V d ( u , v ) E d F ( u , v ) = F w V d ( v , w ) E d ( v , w )
for every vertex v V d .
Intuitively, a circulation is a flow in the directed graph that is conserved at each vertex; that is, the flow into each vertex equals the flow out of each vertex. We define the volume crossing the cut ( S , S ¯ ) in G d as
v o l d ( S ) = u S v S ¯ F ( u , v ) .
Note that, as F is a circulation on G d , we obtain that v o l d ( ( S ) ) = v o l d ( ( S ¯ ) ) .
We now prove that the volume crossing a cut ( S , S ¯ ) in a directed graph G d is the same as the volume of the cut ( S S ) , ( S ¯ , S ¯ ) in its corresponding weighted prime graph G d . To that end, we will assume that the weights of the directed graph G d are given by a circulation F : E d R + { 0 } , and the weights of its corresponding prime graph G u are given as where previously stated.
Proposition 10.
Let G d be a weighted directed graph with weights given by a circulation F, and let G u be its corresponding weighted prime graph. Then, for any cut ( S , S ¯ ) of G d , the corresponding cut ( S S ) , ( S ¯ , S ¯ ) in the prime graph G u satisfies
v o l u ( S S ) = v o l d ( S ) .
Proof of Proposition 10.
Let G d be a weighted directed graph whose weights are given by the circulation F : E d R + { 0 } . In this case, w u , v = F ( u , v ) . Let us denote by G u its corresponding weighted prime graph, and by w i , j its weight values. Now, for the sake of clarity, we will denote by ( S d , S ¯ d ) the cut in the weighted directed graph G d , and denote by ( S S ) , ( S ¯ , S ¯ ) the corresponding cut in the weighted prime graph G u . Then, by definition, we have that
v o l u ( S S ) = u S S v S ¯ S ¯ w u , v .
Notice that, by the way prime graphs are constructed, there are no edges between nodes in S and nodes in S ¯ . The same can be said between nodes in S and nodes in S ¯ . Hence,
v o l u ( S S ) = u S , v S ¯ w u , v + u S v S ¯ w u , v = u S , v S ¯ w u , v + u S ¯ v S w u , v
= u S d , v S ¯ d F ( u , v ) 2 + u S ¯ d v S d F ( u , v ) 2 = 1 2 · v o l d ( S ) + v o l d ( S ¯ )
= 1 2 2 · v o l d ( S ) = v o l d ( S ) .
Consider now any vertex w in G d lying in a cluster. Then, in its corresponding prime graph G u , the nodes v w and v w belong to the same cluster. This latter aspect follows because we have assigned a high weight value to the edge between v w and v w in G u . Now, from the local topology around the vertex w in G d , and the local topology around the vertices v w and v w in G u :
Mathematics 12 01357 i013
we can see that d e g ( v w ) = i n d e g ( w ) + 1 and d e g ( v w ) = o u t d e g ( w ) + 1 , where i n d e g ( w ) and o u t d e g ( w ) denote the indegree and outdegree of vertex w V d , respectively. Further, observe that for any vertex in G d within the same cluster as w, we obtain that its corresponding prime and non-prime nodes belong to the same cluster as v w (and v w ), as the functor L preserves connectivity. Therefore, by functoriality, each cluster in a directed graph G d induces a cluster in its corresponding prime graph G u with twice the number of nodes, namely the prime and non-prime vertices associated to the vertices of the cluster in the directed graph.
Proposition 11.
If C is a cluster in the directed graph G d , then its corresponding cluster in L ( G d ) = G u has twice the number of nodes as C.

Numerical Example: Spectrum of Graph Laplacian

For the technical application, we considered a method involving the graph Laplacian for optimal clustering. For further references, we recommend the reader to see [17,18].
To illustrate that prime graphs preserve the cuts of a simple directed graph, we numerically compute minimum cuts of directed graphs and prime graphs using the graph Laplacian. The directed graph consists of 1000 nodes split into two clusters. The first cluster consists of 450 nodes, and the second cluster consists of 550 nodes. The edge connectivity parameters of the directed graph are as follows. In the first cluster, the inter-cluster connectivity was 0.5 , that is, there was a 50 % chance of connection between nodes; in the second cluster, the inter-cluster connectivity was 0.4 ; finally, the intra-cluster connectivity was 0.1 . Upon constructing the directed graph, we generated an associated prime graph. In Figure 5, we show the values of the sorted eigenvector associated with the second-smallest eigenvalue. This numerical example thus shows that the minimum cut is preserved between directed graphs and prime graphs.

4. Discussion

This work shows a novel construction that reinforces the power of CT as a tool to formalize structures and their relations. In this case, we use CT to bridge a directed graph framework to an undirected graph framework, so that not only directionality is preserved but also several topological features. This bridge enables the use of undirected graph techniques to obtain information from systems that are represented as directed graphs. Both the computational and space complexity of the transformations are O ( N ) , where N is the number of nodes in the network. As an empirical demonstration, we provide a new option to perform network alignment for directed graphs. This is relevant since network alignment tools do not exist for a directed graph setting. Furthermore, our transformation does preserve network similarity between directed graphs and their prime graph counterparts; we attained an R 2 value of 0.98 (with a corresponding p-value of 9 × 10 6 ) between the network aligner results, i.e., the similarity metric, a known graph generation correlation coefficient. Because we proved that our construction leads to an invertible transformation, there is only one prime graph that describes a simple directed graph and vice versa; as such, and in that sense, our transformation is error-free. Be that as it may, our transformation does not mitigate errors inherent in postprocessing the resultant graphs, for example, not achieving an R 2 value of 1 in the network alignment task.
Although the process of making an adjacency matrix of a directed graph symmetric is not new [19], nor is transforming a directed graph into an undirected graph [12], our framework is an advance. We proved that the minimum cuts are preserved when going from a directed graph framework to a prime graph framework and vice versa. These results, in turn, imply that clusters are preserved when moving from one setting to the other. As a proof of concept, we proved cluster preservation by generating a directed SBM network with known intra-block and inter-block connectivity.
While this work is a step towards a new application of existing network alignment tools, there is much left in this area to be explored in future work. Adoption of this technique may be limited by and rely upon showing additional mathematical proofs for commonly used techniques on graphs, for example, answering how the existing undirected node and edge similarity metrics might be skewed by the prime graph transformation. Another avenue for the application of prime graphs is to take advantage of their bipartite nature in problems such as the graph isomorphism problems for directed graphs. It is worthwhile studying the complexity of checking for equivalence between arbitrarily labeled DGraphs and PGraphs. Lastly, a categorical bridge, now between a multidirected graphs setting to a prime graph setting, might unlock new ways to study high complex data.
yes

Author Contributions

Conceptualization, S.P.-G. and J.R.; methodology, S.P.-G. and V.K.G.; software, V.K.G. and V.M.; validation, S.P.-G., V.K.G., V.M., J.R. and G.A.S.; formal analysis, S.P.-G.; investigation, S.P.-G. and V.K.G.; resources, G.A.S.; data curation, V.K.G. and V.M.; writing—original draft preparation, S.P.-G.; writing—review and editing, S.P.-G. and G.A.S.; visualization, S.P.-G.; supervision, G.A.S.; project administration, G.A.S.; funding acquisition, G.A.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research received unrestricted funds to the Center for Engineered Natural Intelligence at the University of California San Diego.

Data Availability Statement

All data and figures of this paper were generated synthetically. The code used in this work can be found in the link https://github.com/vgeorgeucsd/prime_graphs, accessed on 8 April 2024.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Scott, J. Social network analysis. Sociology 1988, 22, 109–127. [Google Scholar] [CrossRef]
  2. Dimitrova, T.; Petrovski, K.; Kocarev, L. Graphlets in Multiplex Networks. Sci. Rep. 2020, 10, 1928. [Google Scholar] [CrossRef] [PubMed]
  3. Pržulj, N.; Wigle, D.A.; Jurisica, I. Functional topology in a network of protein interactions. Bioinformatics 2004, 20, 340–348. [Google Scholar] [CrossRef] [PubMed]
  4. Shen-Orr, S.S.; Milo, R.; Mangan, S.; Alon, U. Network motifs in the transcriptional regulation network of Escherichia coli. Nat. Genet. 2022, 31, 64–68. [Google Scholar] [CrossRef] [PubMed]
  5. Chu, B.K.; Tse, M.J.; Sato, R.R.; Read, E.L. Markov State Models of gene regulatory networks. Syst. Biol. 2017, 11, 1–17. [Google Scholar] [CrossRef] [PubMed]
  6. Buibas, M.; Silva, G.A. A framework for simulating and estimating the state and functional topology of complex dynamic geometric networks. Neural Comput. 2011, 23, 183–214. [Google Scholar] [CrossRef] [PubMed]
  7. Silva, G.A. The effect of signaling latencies and refractory node states on the dynamics of networks. Neural Comput. 2019, 31, 2492–2522. [Google Scholar] [CrossRef] [PubMed]
  8. Fong, B.; Spivak, D.; Tuyéras, R. Backprop as functor: A compositional perspective on supervised learning. In Proceedings of the 2019 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), Vancouver, BC, Canada, 24–27 June 2019; pp. 1–13. [Google Scholar]
  9. Haruna, T. Theory of interface: Category theory, directed networks and evolution of biological networks. Biosystems 2013, 114, 125–148. [Google Scholar] [CrossRef]
  10. Northoff, G.; Tsuchiya, N.; Saigo, H. Mathematics and the Brain: A Category Theoretical Approach to Go Beyond the Neural Correlates of Consciousness. Entropy 2019, 21, 1234. [Google Scholar] [CrossRef]
  11. Otter, N.; Porter, M.A. A unified framework for equivalences in social networks. arXiv 2020, arXiv:2006.10733. [Google Scholar]
  12. Miller, G.L. Graph isomorphism, general remarks. J. Comput. Syst. Sci. 1979, 18, 128–142. [Google Scholar] [CrossRef]
  13. Mamano, N.; Hayes, W.B. SANA: Simulated annealing far outperforms many other search algorithms for biological network alignment. Bioinformatics 2017, 33, 2156–2164. [Google Scholar] [CrossRef]
  14. Vijayan, V.; Saraph, V.; Milenković, T. MAGNA++: Maximizing accuracy in global network alignment via both node and edge conservation. Bioinformatics 2015, 31, 2409–2411. [Google Scholar] [CrossRef] [PubMed]
  15. Sun, Y.; Crawford, J.; Tang, J.; Milenković, T. Simultaneous optimization of both node and edge conservation in network alignment via WAVE. In Proceedings of the International Workshop on Algorithms in Bioinformatics, Atlanta, GA, USA, 10–12 September 2015; pp. 16–39. [Google Scholar]
  16. Trung, H.T.; Toan, N.T.; Van Vinh, T.; Dat, H.T.; Thang, D.C.; Hung, N.Q.V.; Sattar, A. A comparative study on network alignment techniques. Expert Syst. Appl. 2020, 140, 112883. [Google Scholar] [CrossRef]
  17. Chung, F.R.; Graham, F.C. Spectral grAph Theory; Number 92; American Mathematical Society: Providence, RI, USA, 1997. [Google Scholar]
  18. Chung, F. Laplacians and the Cheeger inequality for directed graphs. Ann. Comb. 2005, 9, 1–19. [Google Scholar] [CrossRef]
  19. Satuluri, V.; Parthasarathy, S. Symmetrizations for clustering directed graphs. In Proceedings of the 14th International Conference on Extending Database Technology, Uppsala, Sweden, 21–24 March 2011; pp. 343–354. [Google Scholar]
  20. Chung, J.; Pedigo, B.D.; Bridgeford, E.W.; Varjavand, B.K.; Helm, H.S.; Vogelstein, J.T. GraSPy: Graph Statistics in Python. J. Mach. Learn. Res. 2019, 20, 1–7. [Google Scholar]
  21. Hayes, W.B. An introductory guide to aligning networks using sana, the simulated annealing network aligner. In Protein-Protein Interaction Networks; Springer: Berlin/Heidelberg, Germany, 2020; pp. 263–284. [Google Scholar]
  22. Milenković, T.; Pržulj, N. Uncovering biological network function via graphlet degree signatures. Cancer Inform. 2008, 6, CIN–S680. [Google Scholar] [CrossRef]
  23. Frigge, M.; Hoaglin, D.C.; Iglewicz, B. Some implementations of the boxplot. Am. Stat. 1989, 43, 50–54. [Google Scholar] [CrossRef]
  24. Wright, S. Correlation and causation. J. Agric. Res. 1921, 20, 557–585. [Google Scholar]
Figure 1. A prime graph with eight nodes; four nodes have a prime labeling, while the other four nodes have a non-prime labeling.
Figure 1. A prime graph with eight nodes; four nodes have a prime labeling, while the other four nodes have a non-prime labeling.
Mathematics 12 01357 g001
Figure 2. A prime graph corresponds to a bipartite graph. The set of nodes of a prime graph can be written as the disjoint union of prime labeled nodes and the non-prime labeled nodes.
Figure 2. A prime graph corresponds to a bipartite graph. The set of nodes of a prime graph can be written as the disjoint union of prime labeled nodes and the non-prime labeled nodes.
Mathematics 12 01357 g002
Figure 3. A directed graph G d and its corresponding prime graph G u .
Figure 3. A directed graph G d and its corresponding prime graph G u .
Mathematics 12 01357 g003
Figure 4. Box and whisker plot of network alignment scores of prime graphs as a result of varying the underlying similarity between directed graph pairs. Each column in the plot corresponds to a specific value of ρ , which is the correlation coefficient between a generated pair of graphs. The red line is the linear regression of all of the boxes together with respect to the ρ values. It has an R 2 value of 0.98 with a corresponding p-value of 9 × 10 6 .
Figure 4. Box and whisker plot of network alignment scores of prime graphs as a result of varying the underlying similarity between directed graph pairs. Each column in the plot corresponds to a specific value of ρ , which is the correlation coefficient between a generated pair of graphs. The red line is the linear regression of all of the boxes together with respect to the ρ values. It has an R 2 value of 0.98 with a corresponding p-value of 9 × 10 6 .
Mathematics 12 01357 g004
Figure 5. (A) Plot of the sorted values in the eigenvector associated with the second-smallest eigenvalue for the directed graph. (B) Plot of the sorted values in the eigenvector associated with the second-smallest eigenvalue for the prime graph derived from the directed graph generated in (A).
Figure 5. (A) Plot of the sorted values in the eigenvector associated with the second-smallest eigenvalue for the directed graph. (B) Plot of the sorted values in the eigenvector associated with the second-smallest eigenvalue for the prime graph derived from the directed graph generated in (A).
Mathematics 12 01357 g005
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Pardo-Guerra, S.; George, V.K.; Morar, V.; Roldan, J.; Silva, G.A. Extending Undirected Graph Techniques to Directed Graphs via Category Theory. Mathematics 2024, 12, 1357. https://doi.org/10.3390/math12091357

AMA Style

Pardo-Guerra S, George VK, Morar V, Roldan J, Silva GA. Extending Undirected Graph Techniques to Directed Graphs via Category Theory. Mathematics. 2024; 12(9):1357. https://doi.org/10.3390/math12091357

Chicago/Turabian Style

Pardo-Guerra, Sebastian, Vivek Kurien George, Vikash Morar, Joshua Roldan, and Gabriel Alex Silva. 2024. "Extending Undirected Graph Techniques to Directed Graphs via Category Theory" Mathematics 12, no. 9: 1357. https://doi.org/10.3390/math12091357

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop