1
$\begingroup$

I defined graph and got this visualization

AdjacencyGraph[
{Labeled[v1, "1"],
 Labeled[v2, "2"],
 Labeled[v3, "3"],
 Labeled[v4, "4"],
 Labeled[v5, "5"],
 Labeled[v6, "6"],
 Labeled[v7, "7"],
 Labeled[v8, "8"],
 Labeled[v9, "9"],
 Labeled[v10, "10"]},
 {{0,0,0,1,0,1,1,1,0,0},
  {0,0,0,0,0,1,1,1,1,1},
  {0,0,0,0,0,0,0,1,1,0},
  {1,0,0,0,0,0,0,1,0,0},
  {0,0,0,0,0,1,0,1,0,0},
  {1,1,0,0,1,0,1,0,1,1},
  {1,1,0,0,0,1,0,0,0,1},
  {1,1,1,1,1,0,0,0,0,1},
  {0,1,1,0,0,1,0,0,0,0},
  {0,1,0,0,0,1,1,1,0,0}}]

enter image description here

How I can set other color for vertices 1,2,3,5?

$\endgroup$

closed as off-topic by Kuba, user9660, MarcoB, Sjoerd C. de Vries, Bob Hanlon Dec 13 '15 at 16:32

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Kuba, Community, MarcoB, Sjoerd C. de Vries, Bob Hanlon
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    $\begingroup$ Use the option VertexStyle -> {v1 | v2 | v3 | v5 -> Red}? $\endgroup$ – kglr Dec 13 '15 at 10:01
2
$\begingroup$
AdjacencyGraph[{Labeled[v1, "1"], Labeled[v2, "2"], Labeled[v3, "3"],
Labeled[v4, "4"], Labeled[v5, "5"], Labeled[v6, "6"], 
Labeled[v7, "7"], Labeled[v8, "8"], Labeled[v9, "9"], 
Labeled[v10, "10"]}, {{0, 0, 0, 1, 0, 1, 1, 1, 0, 0}, {0, 0, 0, 0, 
0, 1, 1, 1, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 1, 1, 0}, {1, 0, 0, 0, 0, 
0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 1, 0, 0}, {1, 1, 0, 0, 1, 0, 
1, 0, 1, 1}, {1, 1, 0, 0, 0, 1, 0, 0, 0, 1}, {1, 1, 1, 1, 1, 0, 0, 
0, 0, 1}, {0, 1, 1, 0, 0, 1, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 1, 1, 1, 
0, 0}}, VertexStyle -> {v1 | v2 | v3 | v5 -> Red}]

or

AdjacencyGraph[{{0, 0, 0, 1, 0, 1, 1, 1, 0, 0}, {0, 0, 0, 0, 
0, 1, 1, 1, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 1, 1, 0}, {1, 0, 0, 0, 0, 
0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 1, 0, 0}, {1, 1, 0, 0, 1, 0, 
1, 0, 1, 1}, {1, 1, 0, 0, 0, 1, 0, 0, 0, 1}, {1, 1, 1, 1, 1, 0, 0, 
0, 0, 1}, {0, 1, 1, 0, 0, 1, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 1, 1, 1, 
0, 0}}, , VertexLabels -> Table[i -> Subscript["", i], {i, 
10}], VertexStyle -> {1 | 2 | 3 | 5 -> Red}]

enter image description here

Thanks for @kglr

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.