<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">JAMP</journal-id><journal-title-group><journal-title>Journal of Applied Mathematics and Physics</journal-title></journal-title-group><issn pub-type="epub">2327-4352</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/jamp.2024.124096</article-id><article-id pub-id-type="publisher-id">JAMP-132999</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Physics&amp;Mathematics</subject></subj-group></article-categories><title-group><article-title>
 
 
  On Some Properties of Graph of Prefix Code
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Nikolai</surname><given-names>I. Krainiukov</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Mikhail</surname><given-names>E. Abramyan</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Boris</surname><given-names>F. Melnikov</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib></contrib-group><aff id="aff1"><addr-line>Faculty of Computational Mathematics and Cybernetics, Shenzhen MSU-BIT University, Shenzhen, China</addr-line></aff><pub-date pub-type="epub"><day>11</day><month>04</month><year>2024</year></pub-date><volume>12</volume><issue>04</issue><fpage>1571</fpage><lpage>1581</lpage><history><date date-type="received"><day>22,</day>	<month>February</month>	<year>2024</year></date><date date-type="rev-recd"><day>27,</day>	<month>April</month>	<year>2024</year>	</date><date date-type="accepted"><day>30,</day>	<month>April</month>	<year>2024</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  &lt;div style=&quot;text-align:justify;&quot;&gt; We investigate decomposition of codes and finite languages. A prime decomposition is a decomposition of a code or languages into a concatenation of nontrivial prime codes or languages. A code is prime if it cannot be decomposed into at least two nontrivial codes as the same for the languages. In the paper, a linear time algorithm is designed, which finds the prime decomposition. If codes or finite languages are presented as given by its minimal deterministic automaton, then from the point of view of abstract algebra and graph theory, this automaton has special properties. The study was conducted using system for computational Discrete Algebra GAP. &lt;/div&gt;
 
</p></abstract><kwd-group><kwd>Finite Languages</kwd><kwd> Minimal Deterministic Automata</kwd><kwd> Concatenation</kwd><kwd> Codes</kwd><kwd>  Graph of Automaton</kwd><kwd> Free Algebra</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>A formal language is set of the words over some alphabet [<xref ref-type="bibr" rid="scirp.132999-ref1">1</xref>]. The standard set operations, like union and interception, can be performed under formal languages [<xref ref-type="bibr" rid="scirp.132999-ref2">2</xref>]. Another simple basic operation of formal languages is their concatenation. However, the complexity of the inverse operation of decomposing a formal language into a nontrivial concatenation of factor languages is more sophisticated and has a long history of studying [<xref ref-type="bibr" rid="scirp.132999-ref3">3</xref>]. A concatenation is trivial if one of the languages consists exactly of the empty string {ε}. A non-empty language is said to be prime if it cannot be written as a catenation of two languages neither one of which is the singleton language consisting of the empty word.</p><p>We investigate decomposition problems for the class of finite languages. The finite language is finite set of words. This class contends the codes, the codes are languages recognized by special kind of automata, so-called flower automata. The representation of the finite language in special graph of automata makes it possible to decompose into a product of prime languages.</p><p>Section 2 contains the basic definition and notation of formal languages, codes, graphs, finite automata and formal serials over the semiring.</p><p>Section 3 discusses the algorithm of decomposition prefix codes and finite language and a practical example of application of this algorithm.</p><p>Section 4 applies computer discrete algebra system GAP to decompose prefix codes and finite language.</p></sec><sec id="s2"><title>2. Definitions and Notation</title><p>In this section, we remember the definition and notation about formal languages, codes, free monoid, free algebra, automata and graphs. The following definitions taken from [<xref ref-type="bibr" rid="scirp.132999-ref4">4</xref>] [<xref ref-type="bibr" rid="scirp.132999-ref5">5</xref>] [<xref ref-type="bibr" rid="scirp.132999-ref6">6</xref>] will be used.</p><p>An alphabet Σ is finite set letters Σ = { a , b , c , … } . A word or string w is finite length sequence of letters over alphabet Σ. We denote as Σ * the set of all finite words. The set of Σ * with respect to the concatenation operation forms a free monoid. Language L is subset of monoid Σ * . Free monoid Σ * contains the empty word ε. Semigroup Σ + = Σ * \ ε is monoid Σ * without empty word ε.</p><p>A basic operation of free monoid Σ * is concatenation of two words w = u v . The concatenation can be expanded to the formal languages L 1 , L 2 . The result of concatenation is the language = L 1 ⋅ L 2 = { w | w = v ⋅ u , v ∈ L 1 , u ∈ L 2 } .</p><p>This operation is like integer multiplication. The inverse operation that is factorization is more complicated. There is problem to find factors/divisors for big integer numbers and prime integer numbers.</p><p>The complexity of the inverse operation of decomposing a language L into a nontrivial concatenation L 1 , L 2 is also complicated.</p><p>A concatenation is obvious if one of languages L 1 , L 2 consists exactly of the empty string. A language L is prime language if it cannot be decomposed to a non-trivial concatenation of two languages L<sub>1</sub>∙and L<sub>2</sub>. The prime factorization of language is the decomposition into prime factors, prime languages.</p><p>The problem of prime factorization is undecidable for context-free languages [<xref ref-type="bibr" rid="scirp.132999-ref6">6</xref>]. A set X is a code if any word in X + can be written uniquely as a product of words in X. To say other words, word w ∈ X + has a unique factorization in words from X. A code X never contains the empty word ε, because word w = ε w = w ε has different presentation. Any subset words from a code X is a code too.</p><p>The word u is a prefix of a word v, denoted as u ≤ v , if v = u w , for some w ∈ Σ * . We say that u and v are prefix comparable if either v ≤ u , or u ≤ v . The set X is a prefix code if no element of X is a proper prefix of another element in X. This is equivalent to say that there are no comparable words u ≤ v of the relation ≤ in the set X. For all words u , v ∈ X , if u ≤ v , then u = v .</p><p>We use standard graph theory notions, as contained in [<xref ref-type="bibr" rid="scirp.132999-ref7">7</xref>], so we only fix the notation and give a few definitions and example below.</p><p>A digraph (directed graph) G = ( V , E ) consists of a finite set of vertices V and a set of edges E ⊆ V 2 . For a subset of vertices ⊆ V , let G [ U ] denote the induced sub(di)graph ( U , E ∩ U &#215; U ) , which is obtained by restricting the vertex set V of G to U and redefining the edge set E appropriately.</p><p>The graph G = ( V , E ) has vertices V = { 1 , 2 , 3 , 4 , 5 } and edges E = { ( 1 , 1 ) , ( 1 , 2 ) , ( 1 , 3 ) , ( 2 , 5 ) , ( 5 , 5 ) , ( 5 , 2 ) , ( 3 , 3 ) , ( 3 , 4 ) , ( 4 , 1 ) } (<xref ref-type="fig" rid="fig1">Figure 1</xref>).</p><p>An automaton A [<xref ref-type="bibr" rid="scirp.132999-ref2">2</xref>] [<xref ref-type="bibr" rid="scirp.132999-ref4">4</xref>] [<xref ref-type="bibr" rid="scirp.132999-ref8">8</xref>] over alphabet Σ consists of a set of states Q, the initial states I ⊂ Q , the final/terminal states T ⊂ Q , and a set F ⊂ Q &#215; A &#215; Q called the set of edges. The automaton is denoted by:</p><p>A = ( Q , F , I , T )</p><p>The automaton is finite when the set Q is finite. The language L is recognized by A, denoted L(A), is the set of words in Σ * which are labels of paths from I to T.</p><p><xref ref-type="fig" rid="fig2">Figure 2</xref> shows the automaton A with four states, the set of initial states I = { 1 } , the set of terminal states T = { 3 , 4 } , the set of edges F = { ( 1 , a , 2 ) , ( 1 , a , 4 ) , ( 2 , a , 3 ) , ( 2 , b , 4 ) } . The finite language L ( A ) = { a a , a b , b } is recognized by automaton A.</p><p>Recall that an algebra [<xref ref-type="bibr" rid="scirp.132999-ref9">9</xref>] over a field K is a K-vector space A with a binary operation (multiplication) A &#215; A → A , ( a , b ) → a b specified on it, satisfying the following requirements:</p><p>1) a ( b + c ) = a b + a c , ( b + c ) a = b a + c a for any a , b , c ∈ A ;</p><p>2) ( λ a ) b = a ( λ b ) = λ ( a b ) for any λ ∈ K , a , b ∈ A .</p><p>We will additionally assume that:</p><p>3) There is a unit in A, i.e. an element 1 such that 1 a = a 1 = a for any a ∈ A ;</p><p>4) Algebra A is associative, i.e. ( a b ) c = a ( b c ) for any a , b , c ∈ A .</p><p>Throughout the following, we will additionally assume that the field K is the field of rational numbers or the field Z/2Z. We can embed monoid Σ * over alphabet Σ = { x 1 , x 2 , … x n } into free algebra of polynomials K [ x 1 , x 2 , … x n ] with homomorphism φ : Σ * → K [ x 1 , x 2 , … x n ] by definition on letters of alphabet Σ:</p><p>φ ( x i ) = x i ,   i = 1 , … , n .</p><p>We need to use the formal series over the alphabet Σ with coefficients in semiring K. We recall the definition of semiring [<xref ref-type="bibr" rid="scirp.132999-ref10">10</xref>].</p><p>Let K be a semiring.</p><p>A semiring K is a set equipped with two operations denoted + and ⋅ satisfying the following axioms:</p><p>1) The set K is a commutative monoid for addition + with a neutral element denoted by 0;</p><p>2) The set K is a monoid for multiplication ⋅ with a neutral element denoted by 1;</p><p>3) Multiplication is distributive on addition;</p><p>4) For all x ∈ K , 0 ⋅ x = x ⋅ 0 = 0 .</p><p>A formal series over alphabet Σ with coefficients in K is a mapping:</p><p>σ : Σ * → K</p><p>We denote the set of formal series σ over Σ * by K Σ * or K ≪ Σ * ≫ . The value of σ on w ∈ Σ * is denoted ( σ , w ) and we can formally denote:</p><p>σ = ∑ w ∈ Σ * ( σ , w )</p><p>The support of a series σ ∈ K ≪ Σ * ≫ is the set:</p><p>s u p p ( σ ) = { w ∈ Σ * | ( σ , w ) ≠ 0 } .</p><p>If the set s u p p ( σ ) is finite, then we denote that set of formal series σ by K &lt; Σ * &gt; .</p><p>Another words the set of formal series σ ∈ K Σ * such that ( σ , w ) = 0 for all but a finite number of w ∈ Σ * is denoted K &lt; Σ * &gt; and then σ is called a polynomial.</p><p>We define the formal series + τ , σ τ , and k σ by:</p><p>( σ + τ , w ) = ( σ , w ) + ( τ , w )</p><p>( σ ⋅ τ , w ) = ∑ w = u v ∈ Σ * ( σ , u ) ( τ , v )</p><p>( k σ , w ) = k ( σ , w ) .</p><p>For example, let K is Boolean semiring with addition and multiplication table:</p><p>0 + 0 = 0 ,     0 + 1 = 1 + 0 = 1 ,     1 + 1 = 1</p><p>0 ⋅ 0 = 0 ,     1 ⋅ 0 = 0 ⋅ 1 = 0 ,     1 ⋅ 1 = 1.</p><p>alphabet Σ = { a , b } ,</p><p>and series σ , τ is defined ( σ , a ) = 1 , ( σ , a b ) = 1 , ( τ , ε ) = 1 , ( τ , b ) = 1 :</p><p>σ = 1 ⋅ a + 1 ⋅ a b</p><p>τ = 1 ⋅ ε + 1 ⋅ a b</p><p>Then,</p><p>σ + τ = 1 ⋅ ε + 1 ⋅ a + 1 ⋅ a b</p><p>σ ⋅ τ = 1 ⋅ a + 1 ⋅ a b + 1 ⋅ a a b + 1 ⋅ a b a b</p><p>It is easy to see that in this case, K &lt; Σ * &gt; is a free semiring of noncommutative polynomials and for finite languages X , Y ⊆ Σ * σ X ∪ Y = σ X + σ Y , σ X ⋅ Y = σ X ⋅ σ Y .</p></sec><sec id="s3"><title>3. Decomposition of Codes and Finite Languages</title><p>At the first, we consider decomposition problems for the class of finite prefix codes. Then, subset X is a prefix code if no element of X is a proper prefix of another element in X. This is equivalent to the fact that there are no comparable words u ≤ v of the relation ≤ in the set X. That is for all words, v ∈ X , if u ≤ v , then u = v . For example, the set X = { b b , a b a } is prefix code. A convenient representation for the prefix code is a tree view.</p><p><xref ref-type="fig" rid="fig3">Figure 3</xref> shows the presentation of prefix code X = { b b , a b a } .</p><p>The bold lines present the words of code, the dotted lines present the words ∈ Σ * . A given code X can be associated a subtree of the literal representation of this code X. The infinite tree may present the free monoid Σ * . In this case the root of tree of relation ≤ over Σ * is drawing in <xref ref-type="fig" rid="fig3">Figure 3</xref> as node 1.</p><p>Regular prefix codes are languages recognized by finite automata and such that no word is a prefix of another. The representation of the code is a deterministic finite automaton. Let two automaton A 1 , A 2 present two prefix codes X 1 , X 2 appropriately, then we can draw finite set of words X = X 1 ⋅ X 2 same kind like <xref ref-type="fig" rid="fig3">Figure 3</xref>. In this case, tree presents code X consists of the words of prefix code X<sub>1</sub> and then words of prefix code X<sub>2</sub>. It is easy to see that X is prefix code</p><p>too. The word of code X is the leaf of this tree. There is the only (unambiguous) path from root of this tree to the leafs for each word of code X. Then, deterministic automaton A, which presents code X, has a graph like in <xref ref-type="fig" rid="fig4">Figure 4</xref>. The words u 1 , u 2 , … , u n , v 1 , v 2 , … , v n are words of codes X 1 = { u 1 , u 2 , … , u n } and X 2 = { v 1 , v 2 , … , v n } , where n, m are the number of words in codes X<sub>1</sub> and X<sub>2</sub>.</p><p>We denote the vertex V d i v i s o r of graph G = ( V , E ) of minimal deterministic automaton A and call divisor-border vertex V d i v i s o r of automaton A. The DB-vertex of complete minimal deterministic automaton A [<xref ref-type="bibr" rid="scirp.132999-ref11">11</xref>] of prefix code X is the vertex that we have to divided graph G by this vertex on several automaton A i . The automaton A i is automaton appropriately factors X i of code X = X 1 X 2 … X k .</p><p>Theorem</p><p>A prefix code X = X 1 X 2 … X k is divided on k prefix code X i if and only if a prefix code X has graph G of its minimal deterministic automaton A with ( k − 1 ) DB-vertex.</p><p>Proof</p><p>If prefix code X = X 1 X 2 … X k is divided on k prefix code X i , then the words of this code X present the unambiguous paths from root of the tree for prefix code X to the leaves of the tree. So, we can factorize this tree after the end of words each codes X i as the result of this operation is like <xref ref-type="fig" rid="fig4">Figure 4</xref>. Then, graph G of its minimal deterministic automaton A has ( k − 1 ) DB-vertex.</p><p>If the graph G has ( k − 1 ) DB-vertex, we can prove by mathematical induction. The theorem is obvious for =2. Suppose that it is true for k = n , then prove it for k = n + 1 . We can divide the graph G on last DB-vertex V<sub>n</sub> on two graph G<sub>n</sub> and G<sub>1</sub>. For graph G<sub>n</sub>, we have presentation X 1 X 2 … X n and just concatenate the words of automaton for graph G<sub>1</sub>. The results X = X 1 X 2 … X n X n + 1 .</p><p>Example</p><p>For prime prefix code X 1 = { &quot; a &quot; , &quot; b a &quot; , &quot; b b &quot; } , X 2 = { &quot; a a &quot; , &quot; b a &quot; , &quot; b b &quot; } .</p><p>X = X 1 X 2 = { &quot; a a a &quot; , &quot; a b a &quot; , &quot; a b b &quot; , &quot; b a a a &quot; , &quot; b a b a &quot; , &quot; b a b b &quot; , &quot; b b a a &quot; , &quot; b b b a &quot; , &quot; b b b b &quot; }</p><p>We construct the automaton from the prefix code X.</p><p>Display(A);</p><p>| 1 2 3 4 5 6 7</p><p>---------------------------------------</p><p>a | 5 4 1 6 5 1 4</p><p>b | 5 7 1 3 5 5 4</p><p>Initial state: [ 2 ]</p><p>Accepting state: [ 1 ]</p><p><xref ref-type="fig" rid="fig5">Figure 5</xref> shows the automaton A with DB-vertex (state) V = 4.</p><p>The state V = 5 is a “dead” state of automaton A.</p><p><xref ref-type="fig" rid="fig6">Figure 6</xref> shows Graph G 1 and G 2 for automata A.</p><p>We decompose the prefix code X = X 1 X 2 to the product of two prefix codes X 1 , X 2 .</p><p>Now, we can formulate Theorem of decomposing for finite language L.</p><p>Theorem</p><p>A finite language L = L 1 L 2 … L is divided on k finite languages L i if and only if a finite language L has graph G of its minimal deterministic automaton A with ( k − 1 ) DB-vertex and the number of final state automaton A is equal one.</p><p>Proof</p><p>It is the same as the Theorem for prefix codex.</p><p>Algorithm for factorization prefixes code and finite language.</p><p>Input</p><p>An finite prefix set X = { u 1 , u 2 , … , u n } .</p><p>Step 1</p><p>Built the minimal deterministic automaton A of prefix set X.</p><p>Step 2</p><p>Define the number n of DB-vertex in the graph of automaton A.</p><p>It can be do with complexity of O ( n ⋅ max ( lengthofwordsinprefixset X ) ) .</p><p>Step 3</p><p>Cut the graph of automaton A and find n + 1 factors of prefix set X = X 1 X 2 … X n X n + 1 .</p><p>There is algebraic approach to decomposing the finite language. The main idea is the embedding language L = { v 1 , v 2 , … , v n } into free algebra of polynomials K [ x 1 , x 2 , … , x n ] or set of formal series σ over semiring K. We can embed language L ⊆ Σ * over alphabet Σ = { x 1 , x 2 , … , x n } with homomorphism φ : Σ * → K [ x 1 , x 2 , … , x n ] by definition on letters of alphabet Σ:</p><p>φ ( x i ) = x i ,     i = 1 , … , n</p><p>The homomorphism φ ( v i ) = p i maps the word v i ∈ L into monomials ˚ p i .</p><p>The set of monomials generate the ideal I L . Then, we can try to find the divisors of this ideal I L . We use an exhaustive search for the divisors just added monomials q d with less power to the ideal I L and apply Buchberger algorithm for this set to find the noncommutative Groebner basis. If the Groebner basis will be equals the added monomials q d , then we find this divisors for finite language L. This algorithm has exponential time, but it will be ended because finite alphabet S and finite language L.</p></sec><sec id="s4"><title>4. Apply System GAP for Decomposition Prefix Codes and Finite Language</title><p>The computer discrete algebra system GAP is the system for Groups, Algorithms and Programming. The name GAP reflects the original aim of the system, but now GAP has many packages for wide field investigation of modern algebra. The discrete algebra system GAP has become somewhat broader, and contained the information about algorithms and programming for other algebraic structures, such as semigroups, algebras, discrete automata and many other things.</p><p>Below describes the data and structures used in packages “automata” for finite deterministic and nondeterministic automata [<xref ref-type="bibr" rid="scirp.132999-ref12">12</xref>] [<xref ref-type="bibr" rid="scirp.132999-ref13">13</xref>] and some functions to determine property about them.</p><p>We can easy create free monoid over alphabet Σ = { a , b } .</p><p>gap&gt; m1:=FreeMonoid([&quot;a&quot;,&quot;b&quot;]);</p><p></p><p>gap&gt; gm1:=GeneratorsOfMonoid(m1);</p><p>[ a, b ]</p><p>gap&gt; a:=gm1[<xref ref-type="bibr" rid="scirp.132999-ref1">1</xref>];</p><p>a</p><p>gap&gt; b:=gm1[<xref ref-type="bibr" rid="scirp.132999-ref2">2</xref>];</p><p>b</p><p>alphabet Σ = { a , b } .</p><p>It is easy to form the list of elements free monoid (associative words) and product of two lists:</p><p>gap&gt; s1:=[a,b*a,b*b];</p><p>[ a, b*a, b^2 ]</p><p>gap&gt; s2:=[a*a,b*a,b*b];</p><p>[ a^2, b*a, b^2 ]</p><p>gap&gt; s3:=Mult_Sp(sp1,s2);</p><p>[ a^3, a*b*a, a*b^2, b*a^3, (b*a)^2, b*a*b^2, b^2*a^2, b^3*a, b^4 ]</p><p>Now, we transform the list of associative words to list of words:</p><p>gap&gt; aw1:=AssocWord_Sp(s3, gm1);</p><p>[ &quot;aaa&quot;, &quot;aba&quot;, &quot;abb&quot;, &quot;baaa&quot;, &quot;baba&quot;, &quot;babb&quot;, &quot;bbaa&quot;, &quot;bbba&quot;, &quot;bbbb&quot; ]</p><p>Build the minimal deterministic automaton new3 from list of words:</p><p>new3:=ListOfWordsToAutomaton(&quot;ab&quot;,aw1);</p><p>gap&gt; Display(new3);</p><p>| 1 2 3 4 5 6 7</p><p>------------------------------------------</p><p>a | 5 4 1 6 5 1 4</p><p>b | 5 7 1 3 5 5 4</p><p>Initial state: [ 2 ]</p><p>Accepting state: [ 1 ]</p><p>Then, we can draw the graph of automaton new3:</p><p>newS3:=DotStringForDrawingAutomaton(new3);</p><p>At the last, we discuss algebraic algorithm decomposing the finite set of words free monoid Σ*.</p><p>We can embedding the finite set of words set X = { u 1 , u 2 , … , u n } in free semiring of polynomials as described earlier φ : Σ * → K [ x 1 , x 2 , … , x n ] and find the noncommutative Groebner bases in this ideal generate by polynomials from words { u 1 , u 2 , … , u n } [<xref ref-type="bibr" rid="scirp.132999-ref14">14</xref>]. In our example, K is field of rational numbers.</p><p>gap&gt; A1:=FreeAssociativeAlgebraWithOne(Rationals, &quot;a&quot;, &quot;b&quot;);;</p><p>gap&gt; gA1:=GeneratorsOfAlgebraWithOne(A1);</p><p>[ (1)*a, (1)*b ]</p><p>gap&gt; e:=One(A1);</p><p>(1)*</p><p>gap&gt; a:=gA1[<xref ref-type="bibr" rid="scirp.132999-ref1">1</xref>];</p><p>(1)*a</p><p>gap&gt; b:=gA1[<xref ref-type="bibr" rid="scirp.132999-ref2">2</xref>];</p><p>(1)*b</p><p>We defined the generators of free associative algebra with one.</p><p>Now, we use the list of associative words as the prefix code. The prefix code is the same as above example with automaton new3.</p><p>gap&gt; s2:=[a*a,b*a,b*b];</p><p>[ a^2, b*a, b^2 ]</p><p>gap&gt; s3:=[ a^3, a*b*a, a*b^2, b*a^3, (b*a)^2, b*a*b^2, b^2*a^2, b^3*a, b^4 ];;</p><p>gap&gt; pL2:=[ (1)*a^3, (1)*a*b*a, (1)*a*b^2, (1)*b*a^3, (1)*(b*a)^2, (1)*b*a*b^2, (1)*b^2*a^2, (1)*b^3*a, (1)*b^4,(1)*a^2, (1)*b*a, (1)*b^2 ];;</p><p>gL2:=GP2NPList(pL2);</p><p>[ [ [ [ 1, 1, 1 ] ], [ 1 ] ], [ [ [ 1, 2, 1 ] ], [ 1 ] ], [ [ [ 1, 2, 2 ] ], [ 1 ] ], [ [ [ 2, 1, 1, 1 ] ], [ 1 ] ],</p><p>[ [ [ 2, 1, 2, 1 ] ], [ 1 ] ], [ [ [ 2, 1, 2, 2 ] ], [ 1 ] ], [ [ [ 2, 2, 1, 1 ] ], [ 1 ] ],</p><p>[ [ [ 2, 2, 2, 1 ] ], [ 1 ] ], [ [ [ 2, 2, 2, 2 ] ], [ 1 ] ], [ [ [ 1, 1 ] ], [ 1 ] ], [ [ [ 2, 1 ] ], [ 1 ] ],</p><p>[ [ [ 2, 2 ] ], [ 1 ] ] ][ [ [ 1, 2, 2 ], [ 1, 2, 1 ], [ 1, 1, 1 ], [ 1 ] ], [ 1, 1, 1, 1 ] ]</p><p>Function GP2NPList() transforms list of polynomials into internal presentation polynomials in the package gbnp . Now, we use the list gL2 for</p><p>gap&gt; GB := Grobner(gL2);</p><p>#I number of entered polynomials is 12</p><p>#I number of polynomials after reduction is 3</p><p>#I End of phase I</p><p>#I End of phase II</p><p>#I List of todo lengths is [ 0 ]</p><p>#I End of phase III</p><p>#I The computation took 2 msecs.</p><p>[ [ [ [ 1, 1 ] ], [ 1 ] ], [ [ [ 2, 1 ] ], [ 1 ] ], [ [ [ 2, 2 ] ], [ 1 ] ] ]</p><p>gap&gt; PrintNPList(GB);</p><p>a^2</p><p>ba</p><p>b^2</p><p>The result polynomials a 2 , b a , b 2 consists a basis of divisor for polynomials list [ a 3 , a ∗ b ∗ a , a ∗ b 2 , b ∗ a 3 , ( b ∗ a ) 2 , b ∗ a ∗ b 2 , b 2 ∗ a 2 , b 3 ∗ a , b 4 , a 2 , b a , b 2 ] . Thus, we obtain the decomposition of the prefix code into products of codes using the Buchberger algorithm. Similarly, factorization can be obtained for a finite language.</p></sec><sec id="s5"><title>5. Conclusions</title><p>The linear time algorithm is designed, which finds the prime decomposition for prefix codes. It can be applied to some modifications for finite languages.</p><p>The algorithm for factorization of finite languages has exponential complexity. From the point of view of abstract algebra, we can apply Buchberger algorithm for an exhaustive search of the factors of the finite language.</p><p>The study was conducted using system for computational Discrete Algebra GAP. The results of decomposition of languages are obtained when considering modified graphs of this automaton.</p><p>There is a big gap between complexity factorization of prefix codes (lineal complexity) and finite languages (exponential complexity). Further research will related to the search for a polynomial algorithm to determine the class of languages for which such an algorithm is applicable.</p></sec><sec id="s6"><title>Founding</title><p>This work is supported by a grant from the research program of Chinese universities “Higher Education Stability Support Program” (Section “Shenzhen 2022―Science, Technology and Innovation Commission of Shenzhen Municipality”).</p></sec><sec id="s7"><title>Conflicts of Interest</title><p>The authors declare no conflicts of interest regarding the publication of this paper.</p></sec><sec id="s8"><title>Cite this paper</title><p>Krainiukov, N.I., Abramyan, M.E. and Melnikov, B.F. (2024) On Some Properties of Graph of Prefix Code. Journal of Applied Mathematics and Physics, 12, 1571-1581. https://doi.org/10.4236/jamp.2024.124096</p></sec></body><back><ref-list><title>References</title><ref id="scirp.132999-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Aho, A. and Ullman, J. (1973) The Theory of Parsing, Translation, and Compiling. Vol. 1, Prentice Hall, Upper Saddle River.</mixed-citation></ref><ref id="scirp.132999-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Brauer, W. (1984) Automation Theory: An Introduction to the Theory of Finite Automata. Vieweg + Teubner Verlag, Wiesbaden.</mixed-citation></ref><ref id="scirp.132999-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Mateescu, A., Salomaa, A. and Yu, S. (1998) On the Decomposition of Finite Languages. Technical Report 222, Turku Centre for Computer Science, Turku.</mixed-citation></ref><ref id="scirp.132999-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Lallement, G. (1979) Semigroups and Combinatorial Applications. Wiley &amp; Sons, Inc., Hoboken, NJ, 376 p.</mixed-citation></ref><ref id="scirp.132999-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Berstel, J. and Perrin, D. (2008) Theory of Codes. Academic Press, New York, 345 p.</mixed-citation></ref><ref id="scirp.132999-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Mateescu, A., Salomaa, A. and Yu, S. (2002) Factorizations of Languages and Commutativity Conditions. Acta Cybernetica, 15, 339-351.</mixed-citation></ref><ref id="scirp.132999-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Diestel, R. (2005) Graph Theory. 3rd Edition, Springer, Berlin, 421 p.</mixed-citation></ref><ref id="scirp.132999-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Melnikov, B. (2018) Regular Languages and Nondeterministic Finite Automata. RGSU Publ., Moscow. (In Russian)</mixed-citation></ref><ref id="scirp.132999-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Winberg, E.B. (2005) Course of Algebra. Factorial Press, Providence. (In Russian)</mixed-citation></ref><ref id="scirp.132999-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">Berstel, J. and Perrin, D. (2005) Codes and Automata. Springer, Berlin, 545 p.</mixed-citation></ref><ref id="scirp.132999-ref11"><label>11</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Melnikov</surname><given-names> B. </given-names></name>,<etal>et al</etal>. (<year>2017</year>)<article-title>The Complete Finite Automaton</article-title><source> International Journal of Open Information Technologies</source><volume> 5</volume>,<fpage> 9</fpage>-<lpage>17</lpage>.<pub-id pub-id-type="doi"></pub-id></mixed-citation></ref><ref id="scirp.132999-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Melnikov, B. and Dolgov, V. (2022) Simplified Regular Languages and a Special Equivalence Relation on the Class of Regular Languages. Part I. International Journal of Open Information Technologies, 10, 12-20. (In Russian)</mixed-citation></ref><ref id="scirp.132999-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">Abramyan, M.E. (2021) Computing the Weight of Subtasks in State Minimization of Nondeterministic Finite Automata by the Branch and Bound Method. University Proceedings. Volga Region. Physical and Mathematical Sciences, 2, 46-52. (In Russian) https://doi.org/10.21685/2072-3040-2021-2-4</mixed-citation></ref><ref id="scirp.132999-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">Mora, T. (1994) An Introduction to Commutative and Noncommutative Griibner Bases. Theoretical Computer Science, 134, 131-173.  
https://doi.org/10.1016/0304-3975(94)90283-6</mixed-citation></ref></ref-list></back></article>