Assign multiple attributes to EdgeStyle[]?

I want to give graph edges a unique color and thickness:

Graph[someGraph,
EdgeStyle->{Thickness[someValue],someColor]]

fails. Though it completes successfully with either option:

EdgeStyle->someColor OR EdgeStyle->Thickness[someValue].
Applying the options as a Directive[]:
EdgeStyle->Directive[Thickness[someValue], someColor] 

also fails. As do curly-brackets,{}; parens,(); and any combinations of them.

There are multiple options for vertices, but I cannot find comparable options for edges.

Any and all clues will be graciously accepted.

Hi Roger,

You have to use Directive to specify multiple style specifications. e.g.

Graph[{1 \[UndirectedEdge] 2, 2 \[UndirectedEdge] 3, 3 \[UndirectedEdge] 1},
 EdgeStyle -> {
   1 \[UndirectedEdge] 2 -> Directive[Red, Thickness[0.02]],
   2 \[UndirectedEdge] 3 -> Directive[Green, Dashing[0.03], Thickness[Medium]],
   3 \[UndirectedEdge] 1 -> Directive[Blue, Dotted, Thickness[0.005]]}]

Crossposted here.

I’ve tried something quite similar. I create the list of EdgeStyles exterior to the graph function then pass in the Table[], i.e. List of Lists.

Table[RGBColor[rx/256, rx/256, rx/256] //. 
      rx :> RandomInteger[{31, 255}], {Length[someEdgeList]}]
    eStyle = Rule[someEdgeList[[#]], %[[#]]] & /@ Range[Length[someEdgeList]]

When I create this as Directive[] it fails. The options are properly created but Mathematica ignores the added Thickness[] parameter.

I apologize for my slow response. Had an attic fire and my computer hasn’t had access to electrons since Monday.

Hi Roger,

Sorry to hear about the attic fire, hope nobody was injured.

The code you posted does not include Directive so I am not sure exactly what you tried. This works fine.

edgeList = {1 \[UndirectedEdge] 2, 2 \[UndirectedEdge] 3, 3 \[UndirectedEdge] 1};
SeedRandom[1];
colors = Table[RGBColor[rx/256, rx/256, rx/256] /. rx :> RandomInteger[{31, 255}], {Length[edgeList]}]
eStyle = Rule[edgeList[[#]], Directive[colors[[#]], Thickness[0.02]]] & /@ Range[Length[edgeList]]
Graph[edgeList, EdgeStyle -> eStyle]

Graph[{1 [UndirectedEdge] 2, 2 [UndirectedEdge] 3,
3 [UndirectedEdge] 1},
EdgeStyle → {1 [UndirectedEdge] 2 →
Directive[Opacity[1], Thickness[0.02], Red],
2 [UndirectedEdge] 3 →
Directive[Opacity[1], Thickness[0.03], Blue],
3 [UndirectedEdge] 1 →
Directive[Opacity[1], Thickness[0.04], Green]}]

An alternative

Graph[{Style[1 -> 2, Red, Thick], Style[2 -> 3, Green], Style[3 -> 1, Blue, Thin, Dashed]}]

Dang. I was wrapping Directive[] around Rule[]. No wonder it wouldn’t work. Bonehead error on my part.

Thanks to everyone for their help.

Rohit, I appreciate your concern. The fire was bad but not serious and one was injured. No electricity for a week was annoying.

Graph[someGraph,BaseStyle->{Thickness[someValue],someColor]]

would probably do the trick. I think that EdgeStyle should allow more than one input.