Manuscript Offprint
arXiv:2610.25432Neutrosophic Graph Rewriting as a Computational Model
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Apostolos Syropoulos
Xanthi, Greece
Basil Papadopoulos
Department of Civil Engineering
Democritus University of Thrace
Greece
Binod Kumar Sharma
Department of Computer science and Engineering
Birla Institute of Technology
Extension Center, Lalpur, Ranchi
Jharkhand
India
October 20, 2026
Abstract
Graphs, which are made up of points connected by lines, are used to represent relationships between objects. They are useful for solving problems in computer science, logistics, biology, and other fields, including social networks and the internet. Neutrosophic graphs are graphs whose points and lines are characterized by membership, indeterminacy, and non-membership degrees. In the simplest case, only lines are characterized by these degrees. The process by which we transform one graph to another one is called graph rewriting. It has been shown that graph rewriting can be described mathematically by pushouts, which are category-theoretic structures. It has also shown that fuzzy graphs have this property, and here we prove that neutrosophic graph rewriting can be described by pushouts in a certain category. By providing a fuzzy version of category theory, it is possible to define fuzzy categorical structures and thus to define neutrosophic graph rewriting in a more suitable manner. Since graph rewriting is actually a model of computation, neutrosophic graphs are a neutrosophic model of computation. A hypergraph is a generalization of a conventional graph. It allows a single “hyperline” to connect many points, which is different from regular graph lines that only connect two points. Neutrosophic hypergraphs can be used to reformulate Wolfram’s models, which are supposed to be a mathematical model of reality.
1 Introduction
A graph is a mathematical structure used to visually show the relationship between different items or quantities. It is a fundamental concept in both mathematics and computer science.
Definition 1 A graph, often denoted as , consists of two main parts:
• Vertices (or Nodes): A set of objects, typically represented as points or circles. The set of all vertices is denoted by V.
• Edges (or Links): Connections or relationships between pairs of vertices, represented as lines or curves. The set of all edges is denoted by E.
In computer science, graph rewriting, also known as graph transformation, is a method for methodically changing a graph by applying rewrite rules that substitute a specific subgraph pattern with a new, different graph structure. Graph rewriting has found many applications, for example:
• Graph Neural Networks (GNNs) are neural networks that operate on graphs instead of tabular data. In particular, GNNs are essentially graph transformations [1].
• Origami, the Japanese art of paper folding, has been formalized as graph rewriting [2, 3].
• Compilers can optimize code by manipulating graph-like structures that represent intermediate code, which enables techniques such as loop invariant computation and common subexpression elimination, through the use of graph rewriting [4].
-
It has been shown that category theory offers specifications that can be efficiently implemented through imperative algorithms, and this has been applied to the field of graph transformation. It was demonstrated through the use of examples how this software development paradigm facilitates the rapid composition of efficient and accurate code [5].
-
It has been demonstrated how graph rewriting can been seen as a computational model [6] and in the second section of this chapter we demonstrate this idea.
Pushouts are category theoretic constructs that are used to formalize the changing of a graph by applying rewrite rules—they precisely define how graphs are “glued” together during rewriting. A graph rewriting rule is typically given by a set of morphisms:
where is the left-hand side (pattern to be replaced), is the right-hand side (replacement), is the part preserved during rewriting, and graph morphisms. Thus, is what is common between and . In category theory, when given a set of arrows and of some category , a pushout is a triple with that satisfies the following universal property: for every triple with , there exists a unique arrow making the following diagram commute

Now, it should be obvious why pushouts are actually graph rewriting rules. More generally, we can use two pushouts to define how to delete and then how to add subgraphs. From this step, we can define pushout automata by pushout composition of graphs. For a detailed description of this technique, interested readers should consult the tutorial by Ehrig [7].
A hypergraph is a generalized graph where an edge (usually called hyperedge) can connect any number of vertices—two or more, or even just one. A hypergraph H is a pair , where V is a set of vertices, and E is a set of non-empty subsets of V, called hyperedges. Steven Wolfram [8] proposed some models that are some sort of graph rewriting that can be used to understand known fundamental features of physics. In general, the structures on which these models operate consist of collections of relations between identical, labeled, discrete elements. Wolfram proposed that these structures can be represented by hypergraphs. The elements are the nodes of the hypergraph and the relations are the (directed) hyperedges that connect these elements. For example, the following graph

corresponds to the following set of relations
The order in which these relations are expressed is irrelevant; however, the order in which elements appear within each relation is considered significant (and is evident in the orientations of the hyperedges in the hypergraph). Wolfram’s models are rules for rewriting rewriting collections of relations. A very simple rule is the following one
where x, y, and z stand for any elements. Note that the following rule
is different from the previous one since order within each relation matters. Suppose we have the set of relations and we apply rule 2, then we get the set of relations , where 7 stands for a new node whose label is free (i.e., not assigned to some other node). Now, let us apply the same rule 2 to the new set of relations. The result will be the set . Ther graph that follows is a depiction of this resulting relation.

Neutrosophic sets (sometimes called neutrosophic logic or neutrosophy) are a generalization of fuzzy sets and intuitionistic fuzzy sets, introduced by Florentin Smarandache [9] in the late 1990s. Neutrosophic sets have used in computer science for the analysis of medical images [10]. In a neutrosophic set, each element x is characterized by a triple of functions:
where is the degree of truth (membership), is the degree of indeterminacy (uncertainty, unknown, inconsistent info), and is the degree of falsehood (non-membership). Since we are going to study graph rewriting of neutrosophic graphs we need to provide a definition of these structures:
Definition 2 A neutrosophic graph [11] is an ordinary graph (i.e., a set of vertices and a set of edges connecting these vertices) accompanied by the following functions
-
a function that represents truth;
-
a function that represents indeterminacy; and
-
a function that represents falsity;
such that for all . Clearly, these functions assign membership values to each vertex , representing the truth, indeterminacy, and falsity degrees, respectively, of the proposition “v is a member of the graph G.” Similarly, the membership values of an edge are defined by the following three functions
-
a membership function that represents truth;
-
a membership function that represents indeterminacy;
-
a membership function that represents falsity;
such that for all . These functions represent the truth, indeterminacy, and falsity degrees, respectively, of the proposition “the edge is a member of the graph G.”
Plan of the chapter First we demonstrate how we can actually compute using graph rewriting, then we present neutrosophic graph rewriting and define neutrosophic double pushout graph rewriting and neutrosophic hypergraph rewriting à la Wolfram.
The rules to compute the successor are:
-
If the current bit is 0, change it to 1 and stop (no carry needed).
-
If the current bit is 1, change it to 0 and propagate carry to the next bit.
-
If carry goes past the last bit, add a new 1 node.
We can express these as rewrite patterns:
Rule 1 Increment a 0 bit
when no carry needed.
Rule 2 Increment a 1 bit
propagate carry if necessary.
Rule 3 Carry past the end
Let us apply these rules to number 110 (binary 6) represented as:
In this case, we simply apply Rule 1 and so [0] becomes [1] and we stop. Thus, we get start 1 1 1 1 end
which is the number 7 in binary.
The previous example showed that we can actually compute with graph rewriting. However, this example just verified that we can compute but it is not a proof that we can compute anything that is computable. Max Dauchet [12] has proved that it is possible to simulate Turing machines with graph rewriting. Thus, graph rewriting is Turing-complete, which means that we can compute with it anything we can compute with a Turing machine.
3 Neutrosophic Graph Rewriting
Since neutrosophic graphs are a generalization of ordinary graphs, it makes sense to perform graph rewriting to such graphs. However, authors of other works exploring graph rewriting under vagueness (e.g., see [13]), consider only fuzzy graphs whose vertices form a crisp set and not a fuzzy one. First, we will explore graph rewriting of a restricted version of neutrosophic graphs whose vertices do not have truth, falsity, and indeterminacy degrees. Then, we will briefly explain how we can categorically handle neutrosophic graphs whose set of vertices and edges are also neutrosophic sets.
In general, a fuzzy graph can be represented by a fuzzy relation [13]. Thus, we can adopt this idea and we will view neutrosophic graphs as binary neutrosophic relations:
Definition 3 A binary neutrosophic relation from a (crisp) set X to a (crisp) Y is a neutrosophic subset in , that is, a structure R given by
where , , and . For any , the value is called the degree of a membership of in , is called the degree of indeterminacy of in , and is called the degree of non-membership of in .
Using this definition we define a neutrosophic graph as a pair where V is its set of vertices and R is a binary neutrosophic relation from V to V. Mizoguchi and Kawahara [14] defined a relational calculus that has been redefined for fuzzy relations by Mori and Kawahara [13] and which we redefine for neutrosophic relations.
Definition 4 The (crisp) set of all neutrosophic relations from to will be denoted by . This set contains the relations and , for all .
Assume that , then if and only if , , and for all .
Proposition 1 The set equipped with the relation is a poset.
Proof. The relation is clearly reflexive, transitive, and anti-symmetric. Ergo, equipped with the relation is a poset.
Given two relations , we define the operations and as follows:
When the operands of “⊠” and “⊥” are not finite, we have to replace the operator “min” with the operator “inf” and the operator “max” with the operator “sup,” respectively.
Proposition 2 The quadruple is a lattice with a zero element.
Proof. Any poset is a lattice if and only if all operations and are defined. Obviously for any , these operations are defined, therefore is a lattice. Now, let us define the relation :
It is clear that and the operator “ ” is used to define the relative pseudo-complement in the lattice .
Proposition 3 Suppose that . Then, for any , it is true that
Proof. Suppose that . Then, this means that
for any pair .
This means that . We have assumed that . Conversely, let us suppose that . If
and
then
and
This means that
and
Therefore it holds that
and
Otherwise, it should be true that
and
but we have assumed that
and
Hence, .
Usually, we denote the relatively pseudo-complement by . The following result can be proved using the previous results.
Theorem 1 For any sets A and B, the quadruple is a Heyting algebra.
Definition 5 A neutrosophic relation is regular if and only if , , and or , , and .
Definition 6 Assume that and . Then, is regular with respect to if and only if implies , implies , and implies .
Definition 7 Assume that , , and . Then, a neutrosophic relation is -regular with respect to if for all and
Definition 8 Given a neutrosophic relation , the domain of is a relation defined by
where is the inverse relation of , is the composite relation of and , and is the identity relation of (the diagonal set of ).
Definition 9 Given two neutrosophic graphs and , a partial graph morphism from to is a regular-partial function satisfying .
It is not difficult to show that all neutrosophic graphs and the partial graph morphisms between them form a category, which will be denoted by Pfn(NGraph). Using the same arguments presented in [14], we can prove the following:
Theorem 2 The category Pfn(NGraph) has pushouts.
Recall that any function is a relation and a (crisp) relation is a neutrosophic relation...
In order to apply a rewriting rule to a graph we need a mechanism that will check whether the rule can be applied to a subgraph. This mechanism is called matching. Let us now formalize rewriting rules and matching:
Definition 10 A rewriting rule is a triple , where is a partial function.
Definition 11 An arrow from to is a matching from to if is regular with respect to .
In the crisp case, we can construct the pushout from the rewriting rule and matching. For example, the following pushout square exists in category Pfn of sets and partial functions between them.

The graph is transformed into by applying a rewriting rule together with a matching if . It is customary to denote the previous rewriting square by . The application of a rewriting rule can be viewed as a rewriting square:

Mori and Kawahara [13] have shown that the rewriting square is a pushout square in Pfn(FGraph), the category of fuzzy graphs and partial morphisms between them. Thus, we can prove the following theorem for category Pfn(NGraph).
Theorem 3 Suppose that is a rewriting rule and is a matching. If is a partial morphism, then the rewriting square is a pushout in Pfn(NGraph).
The next thing we need to define is the vague matching condition.
Definition 12 Assume that . Then, is an -matching from to if and only if the relation is -regular with respect to .
Two neutrosophic graphs and are -equal if and only if is -regular with respect to and vice versa.
An alternative approach to the categorical representation of fuzzy graphs has been presented in [15]. Here we adopt the theory developed in [15] to the case of neutrosophic graphs.
Definition 13 Assume that and that is a poset. Then, a neutrosophic fuzzy set is a pair consisting of a set and a membership function . A morphism of fuzzy sets is a function such that , that is, for all . They form the category . Membership functions are represented in gray. The fact that is expressed by the following diagram, which is called -commuting.

Definition 14 A neutrosphic graph consists of a graph and two membership functions , and , where is a posets. A neutrosphic graph homomorphism is a graph homomorphism such that and . All neutrosphic graphs and the neutrosphic graph homomorphism between them form the category NGraph.
Definition 15 A presheaf on a category I is a functor . An arrow of presheaves is a natural transformation between functors. The category of presheaves on I is denoted by .
Suppose that incl : Set → Poset the inclusion functor that gives the coarsest possible partial order, that is, the reflexive relation.
Definition 16 Given a category I and a functor , a (poset) -fuzzy presheaf is a pair consisting of a presheaf and a lax natural transformation , that is, a natural transformation whose naturality squares -commute, as shown in the diagram below right for each . A morphism of -fuzzy presheaves is a natural transformation such that , that is, for all . The result is the category .

Theorem 4 Suppose that I is a small category and a functor . Then, FuzzyPresheaf(I, L) is a quasitopos.
Since a quasitopos is a category for which every finite limit and finite colimit exists, this means that pushouts exists. Therefore, graph rewriting rules can be represented as pushouts. In order to avoid lax natural transformation and other such constructs, we can adopt a definition of fuzzy categories such as those defined in [16].
4 Neutrosophic Hypergraph Rewriting
Neutrosophic hypergraphs of the kind we are interested in are defined as follows [17]
Definition 17 Assume that be a finite set and be a finite family of non-trivial single-valued neutrosophic subsets of V such that
where the edges are single-valued neutrosophic subsets of V,
, for . Then, the pair is a single-valued neutrosophic hypergraph on , is the family of single-valued neutrosophic hyperedges of and is the crisp vertex set of .
We can use the neutrosophic sets to form the cartesian product . Then, we can define a neutrosophic hypergraph by , where . Thus, we have managed to transform a neutrosophic hypergraph to a neutrosophic relation. This means that we can generalize the relational calculus of the previous section for neutrosophic hypergraphs and so we can define hypergraph rewriting as a pushout in some category. In addition, it is possible to reformulate Wolfram's models as rules for rewriting rewriting collections of neutrosophic relations. Of course this is useful once we accept that vagueness is a fundamental property of this world.
5 Conclusions
We have explained why graph rewriting is a model of computation and then we defined categorically neutrosophic graph rewriting. In addition, we showed how an alternative approach to categorical neutrosophic graph rewriting can be used for “full” neutrosophic graphs. Moreover, we briefly examined neutrosophic hypergraph rewriting and its possible applications. We believe this is an exciting field of study and research as there are many things to be examined and studied.
References
[1] Adam Machowczyk and Reiko Heckel. Graph rewriting for graph neural networks. In Maribel Fernández and Christopher M. Poskitt, editors, Graph Transformation, pages 292–301. Springer Nature Switzerland, Cham, Switzerland, 2023.
[2] Tetsuo Ida. Graph rewriting in computational origami. In 13th International Symposium on Symbolic and Numeric Algorithms for Scientific Computing, pages 20–27. IEEE Computer Society, Los Alamitos, CA, USA, 2008.
[3] Tetsuo Ida and Hidekazu Takahashi. Origami fold as algebraic graph rewriting. Journal of Symbolic Computation, 45(4):393–413, 2010. The paper can be downloaded from https://www.sciencedirect.com/science/article/pii/S0747717109001588.
[4] Manfred Nagl. Application of graph rewriting to optimization and parallelization of programs. In Walter Knödel and Hans Jürgen" Schneider, editors, Parallel Processes and Related Automata / Parallele Prozesse und damit zusammenhängende Automaten, pages 105–124. Springer Vienna, Vienna, 1981.
[5] Kristopher Brown, Evan Patterson, Tyler Hanks, and James Fairbanks. Computational category-theoretic rewriting. In Nicolas Behr and Daniel Strüber, editors, Graph Transformation, pages 155–172. Springer International Publishing, Cham, Switzerland, 2022.
[6] D. L. McBurney and M. R. Sleep. Graph rewriting as a computational model. In Akinori Yonezawa and Takayasu Ito, editors, Concurrency: Theory, Language, and Architecture, pages 235–256. Springer Berlin Heidelberg, Berlin, Heidelberg, 1991.
[7] Hartmut Ehrig. Tutorial introduction to the algebraic approach of graph grammars. In Hartmut Ehrig, Manfred Nagl, Grzegorz Rozenberg, and Azriel Rosenfeld, editors, Graph-Grammars and Their Application to Computer Science, pages 1–14, Berlin, Heidelberg, 1987. Springer Berlin Heidelberg.
[8] Stephen Wolfram. A Class of Models with the Potential to Represent Fundamental Physics. Complex Systems, 29(2):107–536, 2020. The paper can be downloaded from https://www.complex-systems.com/abstracts/v29_i02_a01/.
[9] Florentin Smarandache. Neutrosophic set—a generalization of the intuitionistic fuzzy set. In 2006 IEEE International Conference on Granular Computing, pages 38–42, 5 2006.
[10] Deepika Koundal and Bhisham Sharma. 15 - challenges and future directions in neutrosophic set-based medical image analysis. In Yanhui Guo and Amira S. Ashour, editors, Neutrosophic Set in Medical Image Analysis, pages 313–343. Academic Press, 2019.
[11] Nihar Ranjan Panda, Prasanta Kumar Raut, Amarendra Baral, Srikanta Kumar Sahoo, Sakya Singh Satapathy, and Said Broumi. An overview of neutrosophic graphs. Neutrosophic Sets and Systems, 77:450–462, 2025. The paper can be downloaded from https://fs.unm.edu/NSS/NeutrosophicGraphs22.pdf.
[12] Max Dauchet. Simulation of turing machines by a regular rewrite rule. Theoretical Computer Science, 103(2):409–420, 1992.
[13] Masao Mori and Yasuo Kawahara. Fuzzy graph rewritings. Proceedings of the Research Institute for Mathematical Analysis, Kyoto University Research Institute for Mathematical Sciences, 918:65–71, 1995. The paper can be downloaded from http://hdl.handle.net/2433/59676.
[14] Yoshihiro Mizoguchi and Yasuo Kawahara. Relational graph rewritings. Theoretical Computer Science, 141(1):311–328, 1995. Paper freely available from ScienceDirect.
[15] Aloïs Rosset, Roy Overbeek, and Jörg Endrullis. Fuzzy presheaves are quasitoposes. In Maribel Fernández and Christopher M. Poskitt, editors, Graph Transformation, pages 102–122, Cham, 2023. Springer Nature Switzerland.
[16] Apostolos Syropoulos. Categories of fuzzy structures and fuzzy categories. In José Acacio de Barros and Décio Krause, editors, A True Polymath: A Tribute to Francisco Antonio Doria, pages 230–249. College Publications, Rickmansworth, England, 2020.
[17] Muhammad Akram, Sundas Shahzadi, and Arsham Borumand Saeid. Single-valued neutrosophic hypergraphs. TWMS Journal of Applied and Engineering Mathematics, 8(1):122–135, 2018. Paper freely available from https://jaem.isikun.edu.tr/web/.