1
$\begingroup$

I am trying to highlight several subgraphs of a graph using the following command:

 HighlightGraph[
   GridGraph[{10, 10}], {{1 \[UndirectedEdge] 2, 
    2 \[UndirectedEdge] 12}, {4 \[UndirectedEdge] 5, 
     5 \[UndirectedEdge] 15}}, GraphHighlightStyle -> "Thick"]

It turns out that there is no action of GraphHighlightStyle on how my subgraphs look like. Compare with, e.g.,

    HighlightGraph[ GridGraph[{10, 10}], 
         {{1 \[UndirectedEdge] 2,2 \[UndirectedEdge] 12}}, 
            GraphHighlightStyle -> "Thick"]

So what has to be changed so that GraphHighlightStyle actually worked on multiple datasets in HighlightGraph?

$\endgroup$
5
  • $\begingroup$ What kind of output do you want? I get the result I expect: HighlightGraph[ GridGraph[{10, 10}], {{1 \[UndirectedEdge] 2, 2 \[UndirectedEdge] 12}, {4 \[UndirectedEdge] 5, 5 \[UndirectedEdge] 15}}, GraphHighlightStyle -> #] & /@ {Automatic, "Thick", "Dashed"} $\endgroup$
    – ssch
    Commented Nov 18, 2013 at 19:01
  • $\begingroup$ @ssch Which Mathematica version do you use? All three figures from your command are the same on my Mathematica 9.0.1.0. $\endgroup$
    – Artem
    Commented Nov 18, 2013 at 19:04
  • $\begingroup$ Version 8.0.4 Linux $\endgroup$
    – ssch
    Commented Nov 18, 2013 at 19:05
  • $\begingroup$ It worked in Mathematica 8 for me as well, and does not work any longer in Mathematica 9 (at least for me). So maybe someone can suggest a solution for this. $\endgroup$
    – Artem
    Commented Nov 18, 2013 at 19:07
  • $\begingroup$ If you just want to apply GraphHighlightStyle, you can flatten your data: HighlightGraph[GridGraph[{10, 10}], Flatten@{{1 [UndirectedEdge] 2, 2 [UndirectedEdge] 12}, {4 [UndirectedEdge] 5, 5 [UndirectedEdge] 15}}, GraphHighlightStyle -> "Thick"] $\endgroup$
    – halmir
    Commented Nov 18, 2013 at 20:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.