Boolean Expression Based on Hypergraphs with Algorithm

Page 1

AlgebraicStructuresandTheirApplicationsVol...No.(20..)pp.

BOOLEANEXPRESSIONBASEDONHYPERGRAPHSWITH ALGORITHM

MOHAMMADHAMIDI∗,MARZIEHRAHMATIANDAKBARREZAEI

Abstract. ThispaperintroducesanovelconceptofBooleanfunction–basedhypergraph withrespecttoanygivenT.B.T(totalbinarytruthtable).Thisstudydefinesanotation ofkernelsetonswitchingfunctionsandprovesthateveryT.B.TcorrespondstoaMinimum BooleanexpressionviakernelsetandpresentssomeconditionsonT.B.TtoobtainaMinimum irreducibleBooleanexpressionfromswitchingfunctions.Finally,wepresentanalgorithmand soPythonprogramming(withcompleteandoriginalcodes)suchthatforanygivenT.B.T, introducesaMinimumirreducibleswitchingexpression.

1. Introduction

TheconceptofhypergraphhasbeenintroducedbyBergeasageneralizationofgrapharound 1960andoneoftheinitialconcernswastoextendsomeclassicalresultsofgraphtheoryand thenotionofhypergraphhasbeenconsideredasausefultooltoanalyzethestructureofa system.Graphsandhypergraphscanbeusedtodescribethenetworksystems.Today,some featuresofhypergraphsareusedincomputerscience,notablyinmachinelearning,andthere hasbeenalotofresearchaboutusinghypergraphsinrelationaldatabases,whichmightbe MSC(2010):Primary:05C65,94C10

Keywords:Switchingfunction,Booleanfunction–basedhypergraph,switchingkernel,T.B.T. Received:17May2020,Accepted:04July2020. ∗Correspondingauthor

c ⃝ 2020YazdUniversity 1

Alg.Struc.Appl.Vol...No..(20..)..-... viewedasasortofdatamining.Thereasonwhyhypergraphsseemapttodepictrelationsin informationsystems,socialnetworks,documentcenteredinformationprocessing,webinformationsystemsandcomputerscience,aretherelationshipsamongserviceswithinaservice orientedarchitecture[4, 5, 9].Withrespecttotheclassicalhypergraph,Smarandache(2019) addedthesupervertices(agroupofverticesputalltogetherformasupervertex),inorder toformasuperhypergraph(SHG).Therefore,eachSHG-vertexandeachSHG-edgebelong to P (V ),whereVisthesetofvertices,and P (V )meansthepowersetofV.Furtheron, sinceinourworldweencountercomplexandsophisticatedgroupsofindividualsandcomplex andsophisticatedconnectionsbetweenthem,Smarandacheextendedthesuperhypergraphto n-superhypergraph,byextending P (V )to P n(V )thatisthen-powersetofthesetV(i.e. power-setofthepower-setofthepowersetofV,ntimes)[10, 11].Furthermaterialsregarding graphsandhypergraphsareavailableintheliteraturetoo[1, 4, 5, 6, 7, 8].Twomajornew worksonlogicwerepublishedbyprominentBritishmathematicians,formallogicbyAugustus DeMorgan(1806–1871)andthemathematicalanalysisofLogicbyGeorgeBoole(1815–1864). Bothauthorssoughttostretchtheboundariesoftraditionallogicbydevelopingageneral methodforrepresentingandmanipulatinglogicallyvalidinferencesortodevelopmechanical modesofmakingtransitions.Historically,propositionallogicandelectricalengineeringhave beenthemainnurturingfieldsforthedevelopmentofresearchonBooleanfunctions.However, becausetheyaresuchfundamentalmathematicalobjects,Booleanfunctionshavealsobeen usedtomodelalargenumberofapplicationsinavarietyofareas.Inmostapplications,however,moreinformationisavailableregardingtheprocessthatgeneratesthefunctionofinterest asillustratedbyElectricalengineering,Artificialneuralnetworks,Reliabilitytheory,Game theory,Integerprogramming,Distributedcomputingsystems,etc.Inotherview,Boolean expressionshavebeenwidelyusedtorepresentadecision/predicateandanumberofbranch testingandtechniqueshavebeenreportedintheliterature[2, 3].

Regardingthesepoints,thispaperconsiderstheconceptsof,Booleanexpression,hypergraphsandwithrespecttocombinationoftheseconcepts,appliesitincomputerscience.In thispaperweintroducethenotationofswitchingfunctionsandinvestigatestherelationbetweenhypergraphsandswitchingfunctions.Thisstudy,foranyBooleanfunctionconstructs ahyperdiagramwhichiscalledahyperdiagrambasedonagivenBooleanfunctionandinvestigatesomeconditionitbeahypergraphbasedonagivenBooleanfunction.Alsofor allarbitraryhypergraph,isextractedaBooleanfunctiontitledBooleanfunctionablehypergraph.Thereisanaturalquestionthat,doitcorrespondaswitchingexpressionfromany givenT.B.T.Themainourmotivationfromthispaperisextractionanirreducibleswitching expressionfromanyT.B.T.SowedefinetheconceptofBooleanfunction–basedhypergraph andthenotationofunitorssetofBooleanfunctions.Infinal,weapplytheseconceptsand

2

provethateveryT.B.TcorrespondstoaMinimumBooleanexpressionviakernelssetand presentssomeconditionsonT.B.TtoobtainaMinimumirreducibleBooleanexpressionfrom switchingfunctions.

2. Preliminaries

Inthissection,werecallsomedefinitionsandresults,whichweneedinwhatfollows. Let X beanarbitraryset.Thenwedenote P ∗(X)= P (X) ∅,where P (X)isthepower setof X

Definition2.1. [1]Let G = {x1,x2,...,xn} beafiniteset.A hypergraph on G isapair H =(G, {Ei}m i=1)suchthatforall1 ≤ i ≤ m, ∅̸= Ei ⊆ G and m ∪ i=1 Ei = G.Theelements x1,x2,...,xn of G arecalled vertices,andthesets E1,E2,...,Em arecalledthe edges (hyperedges)ofthehypergraph H.Foreach1 ≤ k ≤ m if |Ek|≥ 2,then Ek isrepresentedby acontinuouscurvejoiningitsvertices,if |Ek| =1byacycleontheelement(loop).Ifforall 1 ≤ k ≤ m |Ek| =2,thehypergraphbecomesanordinary(undirected)graph.

Definition2.2. [4]Let G = {x1,x2,...,xn} beafiniteset.A hyperdiagram on G isapair H =(G, {Ek}m k=1)suchthatforall1 ≤ k ≤ m,Ek ⊆ G and |Ek|≥ 1.Clearlyeveryhypergraph isahyperdiagram,whiletheconverseisnotnecessarilytrue. Wesaythattwohyperdiagrams H =(G, {Ek}m k=1)and H′ =(G′ , {E′ k}m ′ k=1)areisomorphic if m = m′ andthereexistsabijection φ : G → G′ andapermutation τ : {1, 2,...,m}→ {1, 2,...,m′} suchthatforall x,y ∈ G,ifforsome1 ≤ i ≤ m,x,y ∈ Ei,then φ(x),φ(y) ∈ Eτ (i),ifforall1 ≤ i ≤ m,x,y ̸∈ Ei,then φ(x),φ(y) ̸∈ Eτ (i) andifforsome1 ≤ i ≤ m,x ∈ Ei, forall1 ≤ j ≤ m,y ̸∈ Ej ,then φ(x) ∈ Eτ (i) and φ(y) ̸∈ Ej .Sinceeveryhypergraphisa hyperdiagram,defineanisomorphichypergraphsinasimilaraway.

3. Switchingexpressionbasedonhypergraph

Inthissection,weapplythenotationoftotalbinarytruthtable(T.B.T)onBooleanvariables andintroducetheconceptofhypergraphableBooleanfunctions,Booleanfunctionablehypergraphsandinvestigatesomeoftheirproperties.Weconsiderevery(switching)Booleanfunction f : Bn → B = {0, 1} by f (x1,x2,...,xn)= m ∏ j=1

kj ∑ i=1 xi,whereforall1 ≤ i ≤ n, xi isa literal (BooleanvariableorthecomplementofaBooleanvariable)and m,j,kj ∈ N.Let n ∈ N,m ∈ N∗ , x1,x2,...,xn bearbitraryBooleanvariablesandforall0 ≤ j ≤ m,f (m)(x1,x2,...,xn) beBooleanfunctions.Wewilldenoteatotalbinarytruthtable(T.B.T)onBooleanvariables x1,x2,...,xn byaset T (f (0),f (1),...,f (m) , x1,..., xn)= {f (0),f (1),...,f (m) , (x1,...,xn)},

Alg.Struc.Appl.Vol...No...(20..)..-... 3

Alg.Struc.Appl.Vol...No..(20..)..-...

Table1. T.B.Twith n variables T (f (0),f (1),...,f (m),x1,x2,...,xn)

x1 x2 ... xn f (0)(x1,...,xn) f (1)(x1,...,xn)... f (m)(x1,...,xn)

00...0 f (0) 1 (x1,...,xn) f (1) 1 (x1,...,xn)... f (m) 1 (x1,...,xn)

00...1 f (0) 2 (x1,...,xn) f (1) 2 (x1,...,xn)... f (m) 2 (x1,...,xn) . . . . . . . . . . . . . . . . . . . . . 00...1 f (0) 2n 1 (x1,...,xn) f (1) 2n 1 (x1,...,xn)... f (m) 2n 1 (x1,...,xn)

11...1 f (0) 2n (x1,...,xn) f (1) 2n (x1,...,xn)... f (m) 2n (x1,...,xn)

Table2. T.B.T T (f,g,x1,x2,x3) x1 x2 x3 fgf + gf.gc(f ) 00010100 00100001 01011110 01101101 10001101 10111110 11000001 11111110

whereforall0 ≤ j ≤ m,f (m)(x1,x2,...,xn),areBooleanfunctions(seeaTable 1)andfor m =0,wewilldenoteitby T (f,x1,x2,...,xn). c(f (x1,...,xn))=1 f (x1,...,xn).

Example3.1. ConsideraT.B.T T (f,g,x1,x2,x3)inTable 2.Thebinaryoperationstogether withaunaryoperationiscomputedinthisTable.

Theorem3.2. (T (f,f ′,x1,...,xn), +,.,c) isaBooleanalgebra. Definition3.3. Let n ∈ N and T (f,x1,x2,...,xn)beaT.B.T.Forall1 ≤ j ≤ 2n define Kernel(fj )= {(x1,x2,...,xn) | fj (x1,x2,...,xn)=0} andwilldenoteby Ker(fj ),ina similaraway Kernel(f )isdefinedanditisdenotedby Ker(f ).

4

Theorem3.4. Let n ∈ N, 1 ≤ j ≤ 2n and T (f,f ′,x1,x2,...,xn) beaT.B.T.Then

(i) Ker(f )= 2n ∪ j=1 Ker(fj );

(ii) Ker(f ′)= Ker(f ) ifandonlyif f ∼ f ′;

(iii) If Ker(f ) ⊆ Ker(f ′),then (f + f ′) ∼ f ;

(iv) If Ker(f ′) ⊆ Ker(f ),then (f.f ′) ∼ f ;

(v) Ker(f + f ′)= Ker(f ) ∩ Ker(f ′);

(vi) Ker(f.f ′)= Ker(f ) ∪ Ker(f ′);

(vii) Ker(c(f ))= Bn \ Ker(f ).

Proof. Let n ∈ N and(x1,...,xn) ∈ Bn

(i)Since Ker(f )= {(x1,...,xn) | 2n ∏ j=1 fj (x1,...,xn)=0},weget (x1,...,xn) ∈ Ker(f ) ⇔∃ 1 ≤ j ≤ 2n suchthat fj (x1,...,xn)=0 ⇔ forsome1 ≤ j ≤ 2n , (x1,...,xn) ∈ Ker(fj ) ⇔ (x1,...,xn) ∈ 2n ∪ j=1 Ker(fj )

(ii)Let(x1,x2,...,xn) ∈ Ker(f ).Then f (x1,x2,...,xn)=0andbecause f ∼ f ′,wegetthat f ′(x1,x2,...,xn)=0.Itfollowsthat(x1,x2,...,xn) ∈ Ker(f ′)and Ker(f ) ⊆ Ker(f ′)andin asimilaraway Ker(f ′) ⊆ Ker(f ).Let Ker(f ′)= Ker(f ).Then f (x1,x2,...,xn)=0implies that f ′(x1,x2,...,xn)=0and f (x1,x2,...,xn)=1impliesthat f ′(x1,x2,...,xn)=1.So f ∼ f ′ .

(iii)If(x1,x2,...,xn) ∈ Ker(f ),then(f + f ′)(x1,x2,...,xn)= f (x1,x2,...,xn)+ f ′(x1,x2,...,xn)=0= f (x1,x2,...,xn).If(x1,x2,...,xn) ̸∈ Ker(f ),then(f + f ′)(x1,x2,...,xn)= f (x1,x2,...,xn)+ f ′(x1,x2,...,xn)=1= f (x1,x2,...,xn). (iv) If (x1,x2,...,xn) ∈ Ker(f ), then(f.f ′)(x1,x2,...,xn)= f (x1,x2,...,xn).f ′(x1,x2,...,xn)=0= f (x1,x2,...,xn).If (x1,x2,...,xn) ̸∈ Ker(f ),because Ker(f ′) ⊆ Ker(f ),wegetthat(x1,...,xn) ̸∈ Ker(f ′)andso(f.f ′)(x1,x2,...,xn)= f (x1,x2,...,xn).f ′(x1,x2,...,xn)=1= f (x1,x2,...,xn).

(v)Bydefinition,(f + f ′)(x1,x2,...,xn)=0ifandonlyif f (x1,x2,...,xn)+ f ′(x1,x2,...,xn)=0ifandonlyif f (x1,x2,...,xn)=0and f ′(x1,x2,...,xn)=0ifand onlyif(x1,x2,...,xn) ∈ Ker(f ) ∩ Ker(f ′). (vi) By definition, (f.f ′)(x1,x2,...,xn) = 0 ifandonlyif f (x1,x2,...,xn).f ′(x1,x2,...,xn)=0ifandonlyif f (x1,x2,...,xn)=0or f ′(x1,x2,...,xn)=0ifandonlyif(x1,x2,...,xn) ∈ Ker(f ) ∪ Ker(f ′).

Alg.Struc.Appl.Vol...No...(20..)..-... 5

Alg.Struc.Appl.Vol...No..(20..)..-...

(vii)(x1,x2,...,xn) ∈ Ker(c(f ))ifandonlyif c(f )(x1,x2,...,xn)=0ifandonlyif 1 f (x1,x2,...,xn) =0ifandonlyif f (x1,x2,...,xn)=1ifandonlyif(x1,x2,...,xn) ̸∈ Ker(f ).

Example3.5. ConsideraT.B.T T (f,g,x1,x2,x3)inTable 2.Computationsshowthat Ker(f + g)= {(0, 0, 1), (1, 1, 0)} = Ker(f ) ∩ Ker(g)= {(0, 0, 1), (1, 0, 0), (0, 1, 1), (1, 1, 0)}∩ {(0, 0, 0), (0, 0, 1), (1, 1, 0)} and Ker(f.g)= {(0, 0, 0), (0, 0, 1), (0, 1, 1), (1, 0, 0), (1, 1, 0)} = Ker(f ) ∪ Ker(g).

Corollary3.6. Let n ∈ N, 1 ≤ j ≤ n and T (f,f ′,x1,x2,...,xn) beaT.B.T.If (f + f ′) ∼ f, then |Ker(f )|≤|Ker(f ′)|

Proof. Since(f + f ′) ∼ f ,byTheorem 3.4, Ker(f + f ′)= Ker(f ).Itfollowsthat Ker(f ) ∩ Ker(f ′)= Ker(f + f ′)= Ker(f )andso Ker(f ) ⊆ Ker(f ′).

Corollary3.7. Let n ∈ N, 1 ≤ j ≤ n and T (f,f ′,x1,x2,...,xn) beaT.B.T.If (f.f ′) ∼ f , then |Ker(f ′)|≤|Ker(f )|

Proof. Since(f.f ′) ∼ f ,byTheorem 3.4, Ker(f.f ′)= Ker(f ).Itfollowsthat Ker(f ) ∪ Ker(f ′)= Ker(f.f ′)= Ker(f )andso Ker(f ′) ⊆ Ker(f ).

Inthissection,consideranyT.B.TandwithrespecttoconceptofKernelsset,trytoextract associatedswitchingexpressiontogivenT.B.T.

Theorem3.8. Let n ∈ N.Thenevery T (f ̸≡ 0,x1,x2,...,xn) correspondstoahypergraph. Proof. Let x1,x2,...,xn bearbitraryBooleanvariables.Consideratotalbinarytruthtable (T.B.T)T (f,x1,x2,...,xn)inTable 1.Supposethatfor k ∈ N andforall i ∈{j1,j2,...,jk},wehave Ker(fi) = ∅.Since n ∑ j=1 xj =0ifandonlyifforall1 ≤ j ≤ n, xj =0,forall j1 ≤ i ≤ jk define fji (x1,x2,...,xn)= x1 + x2 + + xn,where n ∑ j=1 xj =0.Now,forall j1 ≤ i ≤ jk, set Ei = {x1, x2,..., xn | n ∑ j=1 xj = fj (x1,x2,...,xn)}.

Thusitiseasytoseethat H =(G = jk ∪ i=j1

Ei, {Ei}jk i=j1 )isahypergraph.

6

Table3. T.B.Twith3variables T (f,x1,x2,x3) x1 x2 x3 f (x1,x2,x3) 000 f1(x1,x2,x3)=1 001 f2(x1,x2,x3)=1 010 f3(x1,x2,x3)=1 011 f4(x1,x2,x3)=0 100 f5(x1,x2,x3)=0 101 f6(x1,x2,x3)=0 110 f7(x1,x2,x3)=1 111 f8(x1,x2,x3)=1

Wewillcallthehypergraph H inTheorem 3.8,as Booleanfunction–basedhypergraph and willdenoteby(H, T ).

Example3.9. ConsideraT.B.T T (f,x1,x2,x3)inTable 3.Computationsshowthat Ker(f4)= {(x1,x′ 2,x′ 3)},Ker(f5)= {(x′ 1,x2,x3)},Ker(f6)= {(x′ 1,x2,x′ 3)}.Now,itisobtainedaBooleanfunction–basedhypergraph(H, T )inFigure 1 x3 x2

x′ 1 x′ 3 x′ 2

x1

Figure1. Hypergraph(H, T )

Definearelation ∼ onaT.B.T T (f,f ′,x1,x2,...,xn)by f ∼ f ′ ifandonlyifforall (x1,x2,...,xn) ∈ Bn, wehave f (x1,x2,...,xn)= f ′(x1,x2,...,xn)(f ≡ f ′).Itisclearthat ∼ isacongruenceequivalencerelationon T (f,f ′,x1,x2,...,xn).For0 ≤ j,j′ ≤ m,wesaythat T (f (j),x1,x2,...,xn)and T ′(f (j′),x1,x2,...,xn)areequivalent,if f (j) ∼ f (j′)

Theorem3.10. Let 0 ≤ j,j′ ≤ m.If T (f (j),x1,...,xn) and T ′(f (j′),x1,...,xn) areequivalent,thentheirBooleanfunction–basedhypergraphareisomorphic.

Proof. Let0 ≤ j,j′ ≤ m.Since T (f (j),x1,...,xn) ∼T ′(f (j′),x1,...,xn),forall1 ≤ i ≤ 2n wegetthat Ker(f (j) i )= Ker(f (j′) i ).UsingTheorem 3.8, T (f (j),x1,x2,...,xn)correspondsto

Alg.Struc.Appl.Vol...No...(20..)..-... 7

Alg.Struc.Appl.Vol...No..(20..)..-...

(H, T )ifandonlyif T (f (j′),x1,x2,...,xn)correspondsto(H′ , T ′).Hence(H, T ) ∼ = (H′ , T ′)

Definition3.11. Let n ∈ N,m ∈ N∗,1 ≤ k ≤ n and T (f (0),...,f (m),x1,...,xn)beaT.B.T, wherefor0 ≤ t ≤ m,f (t)(x1,...,xn)= 2n ∏ i=1 f (t) i (x1,x2,...,xn).Then (i) Z(n,f (t) , 0)= {j | f (t) j (x1,x2,...,xn)=0, where1 ≤ j ≤ 2n}; (ii) S(k,x1,x2,...,xk, 0)= { n ∑ i=1 xi | k ∑ i=1 xi + n ∑ i=k+1 xi =0}

Example3.12. ConsideraT.B.T T (f,x1,x2,x3)inTable 3.Simplecomputationsshow Z(n,f, 0)= {j | fj (x1,x2,x3)=0, where1 ≤ j ≤ 8} =3,S(3,x1,x2,x3, 0)= {x1 + x2 + x3},S(2,x1,x2, 0)= {x1 + x2 + x3,x1 + x2 + x′ 3},S(1,x1, 0)= {x1 + x2 + x3,x1 + x2 + x′ 3,x1 + x′ 2 + x3,x1 + x′ 2 + x′ 3}, |S(3,x1,x2,x3, 0)| =1, |S(2,x1,x2, 0)| =2and |S(1,x1, 0)| =4.

Theorem3.13. Let n ∈ N, 1 ≤ j ≤ n and T (f,x1,x2,...,xn) beaT.B.T.Then |S(k = j,x1,x2,...,xk , 0)| =2n j .

Proof. Let x1,x2,...,xj be j Booleanvariables.Then j ∑ i=1 xi =0ifandonlyif x1 = x2 = = xj =0.So n ∑ i=j+1 xi =0or n ∑ i=j+1 xi =1.Now, n ∑ i=j+1 xi =1ifandonlyifforsome j +1 ≤ t ≤ n wehave xt =1, wherehave2n j 1cases.Inaddition, n ∑ i=j+1 xi =0ifandonly ifforall j +1 ≤ t ≤ n wehave xt =0. So |S(j,x1,x2,...,xj , 0)| =2n j .

Corollary3.14. Let n ∈ N,m ∈ N∗ and T (f,x1,x2,...,xn) beaT.B.T.Then (i) if k =1,then |S(k,x1,x2,...,xk, 0)| =2n 1; (ii) if k = n 1,then |S(k,x1,x2,...,xk, 0)| =2; (ii) if k = n i,then |S(k,x1,x2,...,xk, 0)| =2i; (i) if k = n,then |S(k,x1,x2,...,xk, 0)| =1. Let n ∈ N and T (f (0),...,f (m),x1,...,xn)beaT.B.T,1 ≤ k ≤ n, 0 ≤ t,t′ ≤ m.Define(f (t)f (t′))(x1,...,xn)= {f (s)(x1,...,xn) | f (s) j (x1,...,xn)= f (t) j (x1,...,xn)f (t′) j (x1,...,xn)forall1 ≤ j ≤ 2n} and(f (t) + f (t′))(x1,...,xn)= {f (s)(x1,...,xn) | f (s) j (x1,...,xn)= f (t) j (x1,...,xn)+ f (t′) j (x1,...,xn)forall1 ≤ j ≤ 2n}. SowehavethefollowingTheorem.

8

Theorem3.15. Let n ∈ N and T (f (0),...,f (m),x1,...,xn) beaT.B.T, 1 ≤ k ≤ n, 0 ≤ t,t′ ≤ m.Then

(i) Z(n, xk, 0)=2n 1; (ii) Z(n, 0, 0)=2n and Z(n, 1, 0)=0; (iii) Z(n, xk.f (t) , 0)=[Z(n, xk, 0)+ Z(n,f (t) , 0)] Z(n, xk + f (t) , 0)

Proof. (i)Let1 ≤ k ≤ n.ThenbyCorollary 3.14,weobtainthat Z(n, xk, 0)= |S(1,x1,x2,...,xk, 0)| =2n 1 (ii)InasimilarwayitisobtainedfromCorollary 3.14 (iii)Let1 ≤ k ≤ n, 1 ≤ j ≤ 2n.Because xk ∼ 0or xk ∼ 1,forall1 ≤ j ≤ 2n,wegetthat (xk.f (t) j ) ∼ 0or(xk.f (t) j ) ∼ f (t) j .If(xk.f (t) j ) ∼ 0,sinceforall1 ≤ j ≤ 2n , 0+ f (t) j = f (t) j by item(ii),wegetthat Z(n, xk.f (t) j , 0)=2n =2n + Z(n,f (t) j , 0) Z(n,f (t) j , 0) =[Z(n, xk, 0)+ Z(n,f (t) j , 0)] Z(n, xk + f (t) j , 0) If(xk.f (t) j ) ∼ f (t) j ,then Z(n, xk.f (t) j , 0)=0+ Z(n,f (t) j , 0).

Theorem3.16. Let n ∈ N and T (f (0),...,f (m),x1,...,xn) beaT.B.T, 1 ≤ k ≤ n, 1 ≤ i ≤ 2n , 0 ≤ t,t′ ≤ m.Then (i) Z(n,f (t).f (t′) , 0)=[Z(n,f (t) , 0)+ Z(n,f (t′) , 0)] Z(n,f (t) + f (t′) , 0); (ii) Z(n,f (t) + f (t′) , 0) ≤ min{Z(n,f (t) , 0),Z(n,f (t′) , 0)}.

Proof. (i)Becauseforall1 ≤ j ≤ 2n and1 ≤ t ≤ m wehave f (t) j = n ∑ i=1 xi and n ∑ i=1 xi ∼ 0, n ∑ i=1 xi ∼ 1orthereexists1 ≤ j ≤ 2n suchthat n ∑ i=1 xi ∼ xj ,sobyTheorem 3.15(iii),the proofisobtained.

(ii)Bydefinition,forall1 ≤ j,j ≤ 2n,f (t) j (x1,x2,...,xn)+ f (t′) j (x1,x2,...,xn)=0ifand onlyif f (t) j (x1,x2,...,xn)= f (t′) j (x1,x2,...,xn)=0,so Z(n,f (t) + f (t′) , 0)= {j | f (t) j (x1,x2,...,xn)= f (t′) j (x1,x2,...,xn)=0, where1 ≤ j ≤ 2n} ≤{j | f (t) j (x1,x2,...,xn)=0, where1 ≤ j ≤ 2n} and Z(n,f (t) + f (t′) , 0)= {j | f (t) j (x1,x2,...,xn)= f (t′) j (x1,x2,...,xn)=0, where1 ≤ j ≤ 2n} ≤{j | f (t′) j (x1,x2,...,xn)=0, where1 ≤ j ≤ 2n}. Hence Z(n,f (t) + f (t′) , 0) ≤ min{Z(n,f (t) , 0),Z(n,f (t′) , 0)}.

Alg.Struc.Appl.Vol...No...(20..)..-... 9

Alg.Struc.Appl.Vol...No..(20..)..-...

Corollary3.17. Let n ∈ N and T (f,f ′,x1,x2,...,xn) beaT.B.T.Then (f.f ′) ∼ f ifand onlyif Z(n,f.f ′ , 0)= Z(n,f, 0).

Theorem3.18. Let n ∈ N, 1 ≤ j ≤ n and T (f,f ′,x1,x2,...,xn) beaT.B.T.Ifthereexists some 1 ≤ i1,i2,...,ik ≤ n suchthat f ′ ∼ k ∑ j=1 xij ,then Z(n,f.f ′ , 0) > 2n k

Proof. Let1 ≤ i1,i2,...,ik ≤ n and f ′ ∼ k ∑ j=1 xij .ByTheorem 3.16, Z(n,f (t).f (t′) , 0)=[Z(n,f (t) , 0)+ Z(n,f (t′) , 0)] Z(n,f (t) + f (t′) , 0) =[Z(n,f (t) , 0)+ Z(n, k ∑ j=1 xij , 0)] Z(n, (f (t))+ k ∑ j=1 xij , 1) >Z(n,f (t) , 0)+2n k Z(n,f (t) , 0)=2n k .

Theorem3.19. Let n ∈ N, 1 ≤ j ≤ n and T (f,f ′,x1,x2,...,xn) beaT.B.Tand f ′ ∼ k ∑ j=1 xij , where 1 ≤ i1,i2,...,ik ≤ n. (i) If Z(n,f, 0) < 2n 1,then (f.f ′) ̸∼ f ; (ii) If Z(n,f ′ , 0)= Z(n,f, 0) and Ker(f ′) ⊆ Ker(f ) implythat f ′ ∼ f ;

Proof. (i)Let(f.f ′) ∼ f .UsingTheorem 3.16, Z(n,f.f ′ , 0)= Z(n,f, 0)+ Z(n,f ′ , 0) Z(n,f +f ′ , 0).Because Z(n,f +f ′ , 0) ≤ min{Z(n,f, 0),Z(n,f ′ , 0)},wegetthat Z(n,f.f ′ , 0) ≥ Z(n,f, 0)+2n k Z(n,f, 0)=2n k,whichisacontradiction.

(ii)Let f ′(x1,...,xn)=0.Then Ker(f ′) ⊆ Ker(f )impliesthat(x1,...,xn) ∈ Ker(f ) andso f (x1,...,xn)=0.Supposethat f ′(x1,...,xn)=1,then Ker(f ′) ⊆ Ker(f )implies that(x1,...,xn) ∈ Ker(f ) \ Ker(f ′)or(x1,...,xn) ̸∈ Ker(f ).If(x1,...,xn) ̸∈ Ker(f ),then f (x1,...,xn)=1andinthiscase f ∼ f ′.If(x1,...,xn) ∈ Ker(f ),then f (x1,...,xn)=0 anditfollowsthat Z(n,f ′ , 0) <Z(n,f, 0),whichisacontradiction.

Theorem3.20. EveryT.B.TcorrespondstoaBooleanexpression.

Proof. Let n ∈ N and T (f,x1,x2,...,xn)beaT.B.T.Ifforall1 ≤ j ≤ 2n,fj (x1,x2,...,xn)= 0,thenconsider g(x1,x2,...,xn) ≡ 0.Inasimilarawaythat,ifforall1 ≤ j ≤ 2n,fj (x1,x2,...,xn)=1,thenconsider g(x1,x2,...,xn) ≡ 1.Now,ifthereexist k ∈ N and1 ≤ j1,j2,...,jk ≤ 2n suchthat fjk (x1,x2,...,xn)=0,thenconsider fj (x1,x2,...,xn)= n ∑ i=1 xi insuchawaythatforall1 ≤ i ≤ n, xi =0.ApplyingTheorem 3.8, H =(G =

10

k ∪ j=1 Ej , {Ej }k j=1)isahypergraph,whereforall1 ≤ j ≤ k,Ej = {x1, x2,..., xn | n ∑ j=1 xj = fj (x1,x2,...,xn)=0} andforall1 ≤ i = j ≤ k weset Fij = Ei ∩ Ej .Ifforall 1 ≤ i = j ≤ k,Fij = ∅,thenconsider g(x1,...,xn)= ∏ 1≤j≤k ∑ α∈Ej

α.Inthiscase,since forall1 ≤ j ≤ k,Ker(fj )= Ker( ∑ α∈Ej

α),byTheorem 3.4, Ker(f )= Ker(g)andso f (x1,x2,...,xn)= g(x1,x2,...,xn). Ifthereexist1 ≤ r ≤ k and i = j ∈{i1,i2,...,ir} such that Fij = ∅,consider gij (x1,x2,...,xn)= ∑ α∈Fij

α.Clearlyforall i1 ≤ i,j ≤ ir,Ker(gij ) ⊆ Ker(f ),soif Z(n, ∏ i1≤i≤ir i1≤j≤is

gij , 0)= Z(n,f, 0),thusbyTheorems 3.4 and 3.19, g ∼ f ,where g(x1,x2,...,xn)= ∏ i1≤i≤ir i1≤j≤is

gij (x1,...,xn).Butif Z(n, ∏ i1≤i≤ir i1≤j≤is

gij , 0) <Z(n,f, 0),consider 1 ≤ s ≤ k, j ∈{j1,j2,...,js} and fj (x1,x2,...,xn)= ∑ β∈Ej

gij ).( js ∏ j=j1

β suchthat Ker( ∏ i1≤i≤ir i1≤j≤is

gij ) = Ker(fj ) ⊆ Ker(f )and Z(n, ( ∏ i1≤i≤ir i1≤j≤is

fj ), 0)= Z(n,f, 0).ThusbyTheorem 3.19,we getthat g ∼ f ,where g(x1,x2,...,xn)=( js ∏ j=j1

fj (x1,...,xn)).( ∏ i1≤i≤ir i1≤j≤is

gij (x1,...,xn)). ConsideraT.B.T T (f,x1,x2,...,xn)and E(f )= {g = g1.g2 ...gm | g ∼ f }.Clearly f ∼ f ,andso E(f ) = ∅.Wesaythat f hasaMinimumBooleanexpressionif,thereexists g = f ∈E(f )suchthat m istheMinimumnaturalinsuchawaythat g = g1.g2 ...gm. Theorem3.21. EveryT.B.TcorrespondstoaMinimumBooleanexpression. Proof. Let n ∈ N and T (f,x1,x2,...,xn)beaT.B.T.UsingTheorem 3.20, E(f ) = ∅ andthereexistsahypergraph H =(G = k ∪ j=1 Ej , {Ej }k j=1),whereforall1 ≤ j ≤ k, Ej = {x1, x2,..., xn | n ∑ j=1 xj =0}.Thusthereexist m ∈ N andBooleanfunctions g1,g2,...,gm insuchawaythat f ∼ (g1.g2 ...gm),whereforall1 ≤ i ≤ m, thereexist 1 ≤ j,j′ ≤ k insuchawaythat x1, x2,..., xn ∈ Fjj′ = ∅ and gi(x1,x2,...,xn)= n ∑ l=1 xl.Inaddition,ifforall1 ≤ j,j′ ≤ k,Fjj′ = ∅,weconsider k = m and gi(x1,x2,...,xn)= n ∑ l=1 xl,where x1, x2,..., xn ∈ Ei.Ifthereexist1 ≤ j,j′ ≤ k insuchawaythat x1, x2,..., xn ∈ Fjj′ = ∅, wechoice1 ≤ j,j′ ≤ k suchthat |Fjj′ | = n 1and M = {1 ≤ j,j′ ≤ k ||Fjj′ | = n 1}.

Alg.Struc.Appl.Vol...No...(20..)..-... 11

Alg.Struc.Appl.Vol...No..(20..)..-...

Clearly |M|≤ k,soif Z(n,f, 0)= Z(n,g1.g2 ...g|M|, 0),then f ∼ g.Butif Z(n,f, 0) > Z(n,g1.g2 ...g|M|, 0),weconsidertheMinimum1 ≤ i ≤ k, andBooleanfunctions fi such that g′ = ∏ i fi,Ker(g) = Ker(g ′) ⊆ Ker(f )and Z(n,f, 0)= Z(n,g′ .( |M| ∏ j=1 gj ), 0).Because Ker(g′ ( |M| ∏ j=1 gj )) ⊆ Ker(f ),byTheorem 3.19,wegetthat(g.g′) ∼ f

Let n,k,λ ∈ N∗.Ahypergraph H =(G, {Ej }k j=1)iscalleda λ-intersectionhypergraph,if forall1 ≤ i,j ≤ k,wehave |Ei ∩ Ej | = λ. Theorem3.22. Let n ∈ N and T (f,x1,x2,...,xn) beaT.B.T.If (H, T ) isa 0-intersection hypergraph,thentheT.B.TcorrespondstoanirreducibleBooleanexpression.

Proof. UsingTheorem 3.20, E(f ) = ∅ andthereexistsahypergraph(H, T )=(G = k ∪ j=1 Ej , {Ej }k j=1),whereforall1 ≤ j ≤ k,Ej = {x1, x2,..., xn | n ∑ j=1 xj =0}.Thusthere exist m ∈ N andBooleanfunctions g1,g2,...,gm insuchawaythat f ∼ (g1.g2 ...gm).Since (H, T )isan0-intersectionhypergraph,forall1 ≤ j,j′ ≤ m wegetthat |Fjj′ | =0.Itfollows that gj (x1,...,xn)= ∑ α∈Ej

α andso {x1, x2,..., xn | n ∑ j=1 xj = gj (x1,x2,...,xn)=0}∩ {x1, x2,..., xn | n ∑ j=1 xj = gj′ (x1,x2,...,xn)=0} = ∅ andso f (x1,x2,...,xn)isanirreducibleBooleanexpression.

ThefollowingExampleshowsthattheconverseofTheorem 3.22,isnotnecessarilytrue. Example3.23. (i)ConsideraT.B.T T (f,x,y,z)inTable 4.Clearly(H, T )isan2intersectionhypergraph,whiletheT.B.TcorrespondstoareducibleBooleanexpression.

(ii)ConsideraT.B.T T (f ′,x,y,z)inTable 4.Obviously,(H, T )isan1-intersection hypergraph,whiletheT.B.TcorrespondstoanreducibleBooleanexpression.

Let n,k,λ ∈ N∗.Ahypergraph H =(G, {Ej }k j=1)iscalledastrong λ-intersectionhypergraph,ifforsome1 ≤ i,j ≤ k,wehave1 ≤|Ei ∩ Ej |≤ λ

ThemethodfortheconstructionofaBooleanexpressionfromanT.B.Tisexplainedin Table 5,Algorithm1basedonTheorem 3.21.

12

Table4. T.B.T T (f,x,y,z) xyzf (x,y,z) f ′(x,y,z) 0000 1 0011 1 0101 0 0111 1 1000 1 1011 1 1101 1 1111 0

Example3.24. (i)ConsideraT.B.T T (f,x,y,z)inTable 6.Let H = {x,y,z,x′,y′,z′} Considertheundirectedhypergraph H′ =(H,E1,E2,E3,E4)inFigure 2,where E1 = {x,y,z′},E2 = {x,y′,z},E3 = {x′,y,z} and E4 = {x′,y′,z′}. z x y′ y z′ x′ Figure2. Undirectedhypergraph H′ =(H,E1,E2,E3,E4) Since E1 ∩ E2 = {x},E1 ∩ E3 = {y},E1 ∩ E4 = {z′},E2 ∩ E3 = {z},E2 ∩ E4 = {y′} and E3 ∩ E4 = {x′} wegetthat f (x,y,z)=(x + y + z′)(x + y′ + z)(x′ + y + z)(x′ + y′ + z′). (ii)ConsideraT.B.T T (f,x,y,z)inTable 7.Let H = {x,y,z,x′,y′,z′}.Consider theundirectedhypergraph H′ =(H,E1,E2,E3,E4)inFigure 3,where E1 = {x,y′,z},E2 = {x,y′,z′},E3 = {x′,y,z′} and E4 = {x′,y′,z′}

Since E1 ∩ E2 = {x,y′}, E1 ∩ E3 = ∅, E1 ∩ E4 = {y′}, E2 ∩ E3 = {z′}, E2 ∩ E4 = {y′,z′} and E3 ∩ E4 = {x′,z′},wegetthat f (x,y)=(x + y′)(y′ + z′)(x′ + z′).

3.1. IrreducibleSwitchingExpressionBasedonaProgram.

Inthissubsection,wepresentaprogram(Pythonprogramming)toaccessesofIrreducible BooleanexpressionforanygivenT.B.T,basedontheAlgorithm1,Table 5.

Alg.Struc.Appl.Vol...No...(20..)..-... 13

Alg.Struc.Appl.Vol...No..(20..)..-...

Table5. Algorithm1

Begin:

1.InputaT.B.T T (f,x1,x2,...,xn).

2.If f ≡ 0or f ≡ 1,thenconsider g ≡ 0or g ≡ 1,respectively.

3.Ifthereexists j ∈{1 ≤ j1,j2,...,js ≤ 2n},suchthat fj (x1,x2,...,xn)=0,then consider Ej = {x1, x2,..., xn | n ∑ j=1 xj = fj (x1,x2,...,xn)=0}.

Withrespecttostep3considerthefollowing:

4.Forall1 ≤ i = j ≤ k and k ∈ N,set Fij = Ei ∩ Ej . 5.Ifforall1 ≤ i = j ≤ k,Fij = ∅ or |Fij | <n 1,thenconsider g(x1,x2,...,xn)= ∏ 1≤i≤k ∑ α∈Ei

α

6.Ifthereexists1 ≤ r ≤ k, and i = j ∈{i1,i2,...,ir} suchthat Fij = ∅ and |Fij |≥ n 1,thenput gij (x1,x2,...,xn)= ∑ α∈Fij

α.

gij , 0)= Z(n,f, 0),thenconsider g(x1,x2,...,xn)= ∏ i1≤i≤ir i1≤j≤is

7.If Z(n, ∏ i1≤i≤ir i1≤j≤is

gij (x1,...,xn)that Ker(gij ) ⊆ Ker(f ) 8.If Z(n, ∏ i1≤i≤ir i1≤j≤is

gij , 0) <Z(n,f, 0),thenconsider1 ≤ s ≤ k, j ∈{j1,j2,...,js}, fj (x1,x2,...,xn)= ∑ β∈Ej

gij ).( js ∏ j=j1

β suchthat Ker( ∏ i1≤i≤ir i1≤j≤is

gij ) = Ker(fj ) ⊆ Ker(f )and Z(n, ( ∏ i1≤i≤ir i1≤j≤is

fj ), 0)= Z(n,f, 0). End. 1 import xlrd 2 import re 3 4sheet=xlrd.open workbook(”input.xlsx”).sheet by index(0) 5 6element names=sheet.row values(0)[: 1] 7elements=[]

14

Table6. T.B.T T (f,x,y)

xyzf (x,y,z) 0001 0010 0100 0111 1000 1011 1101 1110

Table7. T.B.T T (f,x,y,z) xyzf (x,y,z) 0001 0011 0100 0110 1001 1010 1101 1110 x y′ z z′ x′ y

Figure3. Undirectedhypergraph H′ =(H,E1,E2,E3,E4) 8 for i in range(1,sheet.nrows): 9 elements.append(sheet.row values(i))

Alg.Struc.Appl.Vol...No...(20..)..-... 15

Alg.Struc.Appl.Vol...No..(20..)..-... 10 11 if len(elements)!=pow(2,len(element names)): 12 print (”Errorininputfile,rowscountisn’tequalto2ˆn.”) 13 exit(0) 14 15E i=[] 16 for i,elm in enumerate(elements): 17 if (elm[ 1]==0): 18 E=[] 19 for c in range(0,len(elm) 1): 20 if (elm[c]==1): 21 E.append(element names[c]+”’”) 22 else : 23 E.append(element names[c]) 24 E i.append([i,E]) 25 26 def print g(g expr): 27 print (”g(”+”,”.join(element names)+”)=”+g expr) 28 input(””) 29 exit(0) 30 31F ij=[] 32 for i in E i: 33 F=[] 34 for j in E i: 35 if (i!=j): 36 intersection=[x for x in i[1] if x in j[1]] 37 if (len(intersection) >=(len(element names) 1)): 38 F.append([j[0],intersection]) 39 if (F): 40 F ij.append([i[0],F]) 41

16

42F ij len=True 43 for i in F ij: 44 if len(i) >=len(element names) 1: 45 F ij len=False 46 47 if (F ij==[] or F ij len): 48 g=[] 49 for i in E i: 50 g.append(”(”+”+”.join(i[1])+”)”) 51 print g(””.join(g)) 52 53 54g ij=[] 55 for i in F ij: 56 for j in i[1]: 57 g ij.append(”(”+”+”.join(j[1])+”)”) 58g ij=list(dict.fromkeys(g ij)) 59sigma g ij=””.join(g ij) 60 61 62 def calc mult and(expr): 63 expr=re.findall(’ \ ((. ∗ ?) \ )’,expr) 64 for i in expr: 65 v=i.split(”+”) 66 if ”1” notin v: 67 return 0 68 return 1 69 70false g ij=[] 71 for elm in elements: 72 tmp g=sigma g ij 73 for c in range(0,len(elm) 1):

Alg.Struc.Appl.Vol...No...(20..)..-... 17

Alg.Struc.Appl.Vol...No..(20..)..-...

74 if (elm[c]==1): 75

tmp g=tmp g.replace(element names[c]+”’”,”0”) 76

tmp g=tmp g.replace(element names[c],”1”) 77 else : 78

tmp g=tmp g.replace(element names[c]+”’”,”1”) 79 tmp g=tmp g.replace(element names[c],”0”) 80 false g ij.append(calc mult and(tmp g)) 81 82f j=[] 83 for i,elm in enumerate(elements): 84 if (elm[ 1]==0 and false g ij[i]==1): 85 f j.append(”(”+”+”.join([x for x in E i if x[0]==i][0][1])+”)”) 86 87print g(””.join(g ij+f j))

Remark3.25. Wetake n asnumberofvariablesintable,and k asnumberofelementsof Ej .Then

(i) T (Ej )= O(n × 2n),becauseoneouterloopthroughrowsandoneinnerloopthrough columns.

(ii) T (Fij )= O(k2 × n),becausetwonestedloopsthroughelementsof Ej andoneinner loopforgettingintersection.

(iii) Iffor1 ≤ j ≤ 2n , Fj (x1,...,xn)=0or Fj (x1,...,xn)=1complexityis O(2n)forone loopthroughrows.

(iv) Otherscomplexityis T (Ej )+ T (Fij )= O(n × (k2 +2n)).

4. Conclusion

ThecurrentpaperhasdefinedandconsideredthenotionofBooleanfunction–basedhypergraph,alsoisshownthateveryT.B.TcorrespondstoaBooleanexpression.Itinvestigated tocorrespondeveryT.B.TtoaMinimumandirreducibleBooleanexpression.Forsimplifying thecomplexcomputations,weintroduceanAlgorithmandbasedonthisalgorithmweextractedaPythonprogramming.Wehopethattheseresultsarehelpfulforfurtherstudiesin Booleanfunctiontheory.Inourfuturestudies,wehopetoobtainmoreresultsregardingirreducibleBooleanfunction,graphs,hypergraphs,decisiontreebasedonBooleanfunction–based hypergraphandtheirapplications.

18

5. Acknowledgments

Theauthorswishtosincerelythanktherefereesforseveralusefulcomments.

References

[1] C.Berge, GraphsandHypergraphs,NorthHolland,1979.

[2] P.ChandraR.K.Singh,Y., Generationofmutantsforbooleanexpression,J.DiscreteMath.Sci.Cryptogr., (2014),pp.589-607.

[3] J.EldonWhitesitt, BooleanAlgebraandItsApplications,NewYorkDoverPublications,Inc.,1995.

[4] M.Hamidi,A.Borumandsaied, Accessiblesingle-valuedneutrosophicgraphs,J.Appl.Math.Comput., Vol.57(2018),pp.121–146.

[5] M.Hamidi,A.Borumandsaied, AchievableSingle-ValuedNeutrosophicGraphsinWirelessSensorNetworks,NewMath.Nat.Comput.,Vol.14No.2(2018),pp.157–185.

[6] M.HamidiandA.BorumandSaeid, OnDerivableTrees,Trans.Combin.,Vol.8N.2(2019),pp.21–43.

[7] M.HamidiandF.Smarandache, Single-ValuedNeutrosophicDirected(Hyper)GraphsAndApplicationsin Networks,J.Intell.Fuzzy.Syst.,Vol.37N.2(2019),pp.2869–2885.

[8] M.HamidiandR.Ameri, α-DerivableDigraphsanditsApplicationinWirelessSensorNetworking,Discrete.Math.Algorithms.Appl.,(2020).

[9] B.Molnar, ApplicationsofHypergraphsinInformaticsaSurveyandOpportunitiesforResearch,Annales Univ.Sci.Budapest.,Sect.Comp.,Vol.42(2014),pp.261–282.

[10] F.Smarandache, ExtensionofHyperGraphton-SuperHyperGraphandtoPlithogenicn-SuperHyperGraph, andExtensionofHyperAlgebraton-ary(Classical-/Neutro-/Anti-)HyperAlgebra,NeutrosophicSets andSystems,Vol.33(2020),pp.290–296;DOI:10.5281/zenodo.3783103;http://fs.unm.edu/NSS/nSuperHyperGraph-n-HyperAlgebra.pdf.

[11] F.Smarandache, n-SuperHyperGraphandPlithogenicn-SuperHyperGraph,inNidusIdearum,Vol.7,second edition,Ponsasbl,Bruxelles,pp.107-113,2019;http://fs.unm.edu/NidusIdearum7-ed2.pdf.

MohammadHamidi

Departmentofmathematics, PayameNooruniversity,Tehran Tehran,Iran.

m.Hamidi@pnu.ac.ir M.Rahmati

Departmentofmathematics, PayameNooruniversity,Tehran Tehran,Iran.

M.Rahmati@pnu.ac.ir A.Rezaei

Departmentofmathematics,

Alg.Struc.Appl.Vol...No...(20..)..-... 19

Alg.Struc.Appl.Vol...No..(20..)..-...

PayameNooruniversity,Tehran Tehran,Iran. rezaei@pnu.ac.ir

20

Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.