相关疑难解决方法(0)

在Mathematica中创建具有不同颜色边缘的图形

我想创建一个图形(图形理论),其中某些边缘与其他边缘具有不同的颜色,这将用于突出图形中从一个顶点到另一个顶点的路径.

以下是一些具有不同颜色边缘的示例http://demonstrations.wolfram.com/AGraphTheoryInterpretationOfTheSumOfTheFirstNIntegers/http://demonstrations.wolfram.com/Ramsey336/.我查看了这些的源代码,但这些解决方案似乎很复杂.我需要一个简单的例子来工作.我估计我需要使用EdgeRenderingFunction作为其中一个选项GraphPlot.

此外,在"更多信息"部分的EdgeRenderingFunction文档中,它说:

Mathematica图形

这看起来很有用,但遗憾的是没有编码示例可供尝试.

从字面上看,我尝试了类似的东西

GraphPlot [{1 - > 2,2 - > 3,3 - > 4,4 - > 1,2 - > 4,4 - > 5,4 - > 6},VertexLabeling - > True,
EdgeRenderingFunction - > g [{ 1,2},{1,2},红色]]

但那不行.它需要更聪明的东西.

wolfram-mathematica graph-theory colors edges

5
推荐指数
1
解决办法
2399
查看次数

标签 统计

colors ×1

edges ×1

graph-theory ×1

wolfram-mathematica ×1