Message Boards Message Boards


Avoid problem with a function to combine two graphs at edges?

Posted 4 months ago
0 Replies
0 Total Likes

This isn't a particularly complex function. I pass it a couple of graphs and the vertices of the edges that are to become coincident. It appears to work but sometimes the vertex order is changed. Always the duplicated edge is not drawn.

If I extract the EdgeStyle values from the resultant graph and redraw from that data the duplicate edge is drawn but its color is drawn incorrectly.

Can someone point out where I am making an error or what I am failing to comprehend.

Attached the relevant code and results as a pdf.

Just looked at the pdf and realized it might not be as clear as I thought. Here's my method:

  • Set the vertices of the joining graph to the vertices they will join.
  • Update the other vertices of the joining graph.
  • Extract the EdgeStyles of the joining graph and update the edges to their new values.
  • Union the joined graph with the modified joining graph.
  • Update the EdgeStyle for the joined graph.
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract