5
$\begingroup$

For the two complex weighted hypergraphs {$G_{1}: w1$ for edge $(d_{1},d_{2})$; $G_{1}: w2$ for edge ($d_{1},d_{3}$) } sharing one vertex $d_{1}$, I use different color for the complex angle and transparency for the complex radial (usually a color wheel can stand for such complex domain, see halirutan's solution for plotting colorwheel).

Here the HypergraphPlot function is from Jaebum Jung's hypergraph plotting:

fig1 = HypergraphPlot[{{Subscript[d, 1], Subscript[d, 2]}, {Subscript[d, 1], Subscript[d, 3]}}, 
  "SubsetBoundaryStyle" -> (Directive[EdgeForm[{Thickness[0.003], Black}], #] & /@ {Green, Red}), 
  "SubsetBoundaryScale" -> {2, 2, 2, 2}, "SubsetEdge" -> False, PlotTheme -> "Classic"]

There in the above example {$G_{1}: w_{1}=1$, red color ; $G_{2}: w_{2}=I$, green color }, the hypergraph is plotting as following fig1:

fig1

Now the question is how can I show the overlap region with the correct color for the summed weights $w_{3}=w_{1}+w_{2}$ for vertex $d_{1}$? Assume red + green~ yellow, so the fig1 should be fig2 as I want. But I don't know how to show up the overlapped region.

common fig

The way I do is quite stupid -- adding one more hypergraph that only contains vertex $d_{1}$ with the correct color to cover the common region.

fig2=HypergraphPlot[{{Subscript[d, 1], Subscript[d, 2]}, {Subscript[d, 1], Subscript[d, 3]}, {Subscript[d, 1], Subscript[d, 1]}}, 
 "SubsetBoundaryStyle" -> (Directive[EdgeForm[{Thickness[0.003], Black}], #] & /@ {Red, Green, Yellow}), "SubsetBoundaryScale" -> {2, 2, 2, 2}, 
 "SubsetEdge" -> False, PlotTheme -> "Classic"]

But I think it's not a good idea because if I have complicated hypergraphs and the common regions are randomly, I cannot always put additional edges to cover and I can see the adding edges cannot follow obviously the original overlapped curves.

Is there any clever way to do such color common regions with graphs? Thank you very much in advance! If something is unclear, thank you for pointing out!

| improve this question | | | | |
$\endgroup$
  • $\begingroup$ What is HypergraphPlot? Is it the one from function repository? $\endgroup$ – Silvia Nov 22 '19 at 4:39
  • $\begingroup$ @Silvia, Hypergraph is more general, which can contain arbitrary vertex in one edge. yes, I use the function from Jaebum Jung's FunctionRepository for hypergraph. ha, sorry, I just found the link is wrong, I edited it now. $\endgroup$ – Xuemei Gu Nov 22 '19 at 4:50
  • $\begingroup$ Thanks for clarification. HypergraphPlot is not a built-in function, so I was just asking for sure. I think the mathematical-optimization tag is irrelevant here thus removed it. Please feel free to roll back if you believe otherwise. $\endgroup$ – Silvia Nov 22 '19 at 5:02
  • $\begingroup$ @Silvia, thank you very much for pointing out :) I didn't realize that. $\endgroup$ – Xuemei Gu Nov 22 '19 at 5:04
  • $\begingroup$ One way is to add Opacity[.3] into your Directive expression. $\endgroup$ – Chip Hurst Nov 22 '19 at 18:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.