arXiv:2610.25432cs.LOOct 2026

Manuscript Offprint

arXiv:2610.25432

Neutrosophic Graph Rewriting as a Computational Model

Apostolos Syropoulos, Basil Papadopoulos, Binod Kumar Sharma

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Apostolos Syropoulos

Xanthi, Greece

asyropoulos@yahoo.com

Basil Papadopoulos

Department of Civil Engineering

Democritus University of Thrace

Greece

papadob@civil.duth.gr

Binod Kumar Sharma

Department of Computer science and Engineering

Birla Institute of Technology

Extension Center, Lalpur, Ranchi

Jharkhand

India

bksharma@bitmesra.ac.in

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 G=(V,E)G = (V, E), 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:

L←lK→rRL\xleftarrow{l}K\xrightarrow{r}R

where LL is the left-hand side (pattern to be replaced), RR is the right-hand side (replacement), KK is the part preserved during rewriting, ll and rr graph morphisms. Thus, KK is what is common between LL and RR. In category theory, when given a set of arrows f:A→Bf: A \to B and g:A→Cg: A \to C of some category C\mathcal{C}, a pushout is a triple (D,α,β)(D, \alpha, \beta) with β∘g=α∘f\beta \circ g = \alpha \circ f that satisfies the following universal property: for every triple (E,α′,β′)(E, \alpha', \beta') with β′∘g=α′∘f\beta' \circ g = \alpha' \circ f, there exists a unique arrow θ:D→E\theta: D \to E making the following diagram commute

Figure

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 H=(V,E)H = (V, E), 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

Figure

corresponds to the following set of relations

{{1,2},{1,3},{2,3},{4,1}}.\left\{\left\{1,2\right\},\left\{1,3\right\},\left\{2,3\right\},\left\{4,1\right\}\right\}.

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

{{x,y}}→{{x,y},{y,z}},(1)\{\{x,y\}\}\to\{\{x,y\},\{y,z\}\}, \tag{1}

where x, y, and z stand for any elements. Note that the following rule

{{x,y}}→{{z,y},{y,x}}(2)\{\{x,y\}\}\to\{\{z,y\},\{y,x\}\} \tag{2}

is different from the previous one since order within each relation matters. Suppose we have the set of relations {{1,2}}\{\{1,2\}\} and we apply rule 2, then we get the set of relations {{7,2},{2,1}}\{\{7,2\},\{2,1\}\}, 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 {{8,2},{2,7},{9,1},{1,2}}\{\{8,2\},\{2,7\},\{9,1\},\{1,2\}\}. Ther graph that follows is a depiction of this resulting relation.

Figure

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:

A(x)=(T(x),I(x),F(x)),A(x)=\left(T(x),I(x),F(x)\right),

where T(x)T(x) is the degree of truth (membership), I(x)I(x) is the degree of indeterminacy (uncertainty, unknown, inconsistent info), and F(x)F(x) 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

  1. a function T:V→[0,1]T: V \to [0,1] that represents truth;

  2. a function I:V→[0,1]I: V \to [0,1] that represents indeterminacy; and

  3. a function F:V→[0,1]F: V \to [0,1] that represents falsity;

such that 0≤T(v)+I(v)+F(v)≤30 \leq T(v) + I(v) + F(v) \leq 3 for all v∈Vv \in V. Clearly, these functions assign membership values to each vertex v∈Vv \in V, 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 (u,v)∈E(u, v) \in E are defined by the following three functions

  1. a membership function T:E→[0,1]T: E \to [0,1] that represents truth;

  2. a membership function I:E→[0,1]I: E \to [0,1] that represents indeterminacy;

  3. a membership function F:E→[0,1]F: E \to [0,1] that represents falsity;

such that 0≤T(u,v)+I(u,v)+F(u,v)≤30 \leq T(u, v) + I(u, v) + F(u, v) \leq 3 for all (u,v)∈E(u, v) \in E. These functions represent the truth, indeterminacy, and falsity degrees, respectively, of the proposition “the edge (u,v)(u, v) 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.