Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • $\begingroup$ Seems like removing the unwanted edges form the definition is the most straightforward way: in this case, Graph[Most[e]] will give you the same connectivity as what you are asking for. (The picture doesn't look the same, but the graph is the same). $\endgroup$ Commented May 31, 2013 at 20:04
  • $\begingroup$ If your graph g is already defined, then you can use EdgeList[g] to get the edges, then remove the ones you want. $\endgroup$ Commented May 31, 2013 at 20:35
  • $\begingroup$ Your question answers perfectly my original question. Would you happen to know how I can preserve the EdgeStyle associated with the edges? Seems like Options[g,{EdgeStyle}] doesn't work because it includes an EdgeStyle for every edge in the original graph g. Anyway, since I changed the meanings of my question after you had answered, I will definitely accept your answer. I will keep working on the problem and update your question if I crack it. $\endgroup$ Commented May 31, 2013 at 20:51
  • $\begingroup$ I'm not sure how to do it staying within EdgeStyle. A more straightforward way would be to define the styling via a list and to then index into that list exactly as you are indexing into the edgelist. That way the styling would stay consistent. $\endgroup$ Commented May 31, 2013 at 21:09
  • 1
    $\begingroup$ If you want to preserve the layout of the graph, check out this answer about keep node locations mathematica.stackexchange.com/a/11106/2393 $\endgroup$ Commented Jun 1, 2013 at 5:58