# plot and sum colors of the common region in hyper-graph?

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:

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.

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!

• What is HypergraphPlot? Is it the one from function repository? – Silvia Nov 22 '19 at 4:39
• @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. – Xuemei Gu Nov 22 '19 at 4:50
• 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. – Silvia Nov 22 '19 at 5:02
• @Silvia, thank you very much for pointing out :) I didn't realize that. – Xuemei Gu Nov 22 '19 at 5:04
• One way is to add Opacity[.3] into your Directive expression. – Chip Hurst Nov 22 '19 at 18:51