There is a list of UndirectedEdge
:
list=list = {1 \[UndirectedEdge]<-> 2, 2 \[UndirectedEdge]<-> 3, 4 \[UndirectedEdge]<-> 5}
How to change it to:
{101 \[UndirectedEdge]<-> 102, 102 \[UndirectedEdge]<-> 103, 104 \[UndirectedEdge]<-> 105}
?
I tried :
list /. UndirectedEdge[x_, y_] /; x :> x + 100;
list /. x_ \[UndirectedEdge]<-> y_ /; x + 100 \[UndirectedEdge]<-> y + 100;
list /. x_UndirectedEdge /; First[x] \[UndirectedEdge]<-> Last[x]
list /. x_UndirectedEdge /; x :> First[x] \[UndirectedEdge]<-> Last[x];
but they are not working correctly.