Question: An graph theory a algorithm to be implemented

Let G(V,E)  be a graph

 Step 1 : Choose the subsets S of the V of size k and LABEL it with the say "1"

Step 2: LABEL all the neighbours of the vertices of S with "1"

Step 3: Now LABEL "1" all the UNLABELED neighbours of the previously LABELED veritices only if its neighbours are all LABELED already

Step 4: IF atleast one vertex is LABELED in step 3 then repeat step 3   ELSE  If all vertices are already LABELED with "1" goto step 5 ELSE if some of the VERTICES are still not LABELED we reject this set GOTO step 6

Step 5: append the the the set S into the list 

Step 6: Remove all the perivious labels choose a new set of size k from S label its vertices with "1" and goto step 2  if all all sets of size k have already been choosen we end and print the list.

That is we a Function F(Graph::G,k)     the function which does the above so that it can be called with parameter when required for any graph G

I am going to try too but i am not that great at coding I have desinged the algorithm need help if possible kind help

I will also be trying 

I apologize to distrub all in your busy schedule.

Your work will be surely acknowledged 

First_sample_1.mw

 

https://www.mapleprimes.com/questions/234533-How-To-Relabel-Only-A-Subset-Of-Vertex-Of-G#comment287899

 

Some part in above link

In code attached 

I would like to 

I have to on say L list.

And I have done steps at the top in that code

After the above code I have attached steps

"Find the vertices with the condition that if  all its neighbors are labeled as character (FIND(G)) then label those vertices  also as `character"`  then add those vertices also to  L1 list"  then Need to be do again and again on the same graph with new labels G

If no such vertex exits and NumberOfVertices(G) not equal to numelems(L1) then i have to break out of the loop.

or 

if NumberOfVertices(G)=numelems(L1) then I print That list or store it some where

Please pardon me if my english is bad.

KInd help it will help me a lot and it will surely be acknowledged kind help.

 

The algorithm all told above kind help please please

The help will be surely acknowledged

 

 

 

Please Wait...