One can make graphs
GraphPlot[{1 -> 2, 2 -> 3, 3 -> 4, 4 -> 5, 5 -> 1, 1 -> 1, 5 -> 5}]
and one can generalize the input such that one labels edges
GraphPlot[{1 -> 2, {2 -> 3, "my favorite edge"}, 3 -> 4, 4 -> 5, 5 -> 1, 1 -> 1, 5 -> 5}]
Now in the Mathematica help for GraphPlot, under Options and then EdgeRenderingFunction one finds the example
GraphPlot[{1 -> 2, 2 -> 3, 3 -> 4, 4 -> 5, 5 -> 1, 1 -> 1, 5 -> 5},
EdgeRenderingFunction -> (If [
First[#2] == Last[#2], {Red, Arrow[#1]}, {GrayLevel[0.5],
Arrow[#1]}] &)]
I want to use this to change the color of edges according to their naming, i.e. if the edge says "my favorite edge", then that edge should be green.
Problem is that once I use EdgeRenderingFunction,
GraphPlot[{1 -> 2, {2 -> 3, "my favorite edge"}, 3 -> 4, 4 -> 5, 5 -> 1, 1 -> 1, 5 -> 5},
EdgeRenderingFunction -> (If [
First[#2] == Last[#2], {Red, Arrow[#1]}, {GrayLevel[0.5],
Arrow[#1]}] &)]
the data beyond "2 -> 3" gets ignored. How to solve this problem?
(I don't really have to use EdgeRenderingFunction to change the color, I just want more than just the names to point out some special edges.)