# Question:Looking to write to extract an other format of representation from the edges set of a graph

## Question:Looking to write to extract an other format of representation from the edges set of a graph

Maple 2022

I am trying to give an input to an R program from an output the edge set of maple code

Now how to Build a function which takes a list of edge sets as inputs and returns a list on the below format

Show I want for one edge set of the list

Now I have edge set of a Graph G say {{1,2},{2,3},{3,4},{4,5}}

Now want to pick the first values of each index make one set

from<-c(1,2,3,4)

Similiarly first values of each index make one more set

to<-c(2,3,4,5)

Then I want to form a list [from<-c(1,2,3,4),to<-c(2,3,4,5),ft <- cbind(from, to),Graph1<-ftM2graphNEL(ft)]

Now it will take second graph in the Edge list say {{1, 2}, {1, 7}, {2, 3}, {3, 4}, {4, 5}, {5, 6}, {6, 7}}

It will append to the previous list like

[from<-c(1,2,3,4),to<-c(2,3,4,5),ft <- cbind(from, to),Graph1<-ftM2graphNEL(ft),from<-c(1,1,2,3,4,5,6),to<-c(2,7,3,4,5,6,7),ft <- cbind(from, to),Graph2<-ftM2graphNEL(ft)]

This time Graph1 is changed to Graph2 to be observed.

Like that it will need  increase graph number based on the number of edge sets in the list of edges.

To be done all edge sets in list

As then I can copy the entire contents in the list and paste in R so that i can run

As I can have 100 or more graphs done in maple doing for each of them manually typing may be difficult.

Your help will be surely Acknowledged

Kind help

A toy code i simply tried for graph attached

But I have errors some come with double quotes can something be done if possible please guide

Kind help

As with 100 of lines it will easy to copy paste

If the contents of the list can be written to txt file it would be helful