2012-01-30 45 views
0

有谁知道如何更改图属性“Norm”。命令;如何更改附属于整个图的属性

G = SetProperty[G, "GraphProperties" -> {"Norm" -> 1}] 

不能正常工作。这是图的构造函数;

G = Graph[{Property[1, "Potential" -> 11],2,3,4}, 
      {Property[2 -> 1, "PreferenceIntensity" -> 5], 3 -> 1, 3 -> 2, 1 -> 4}, 
      EdgeWeight -> {5, 3, 4, 2}, 
      Properties -> {"GraphProperties" -> {"Norm" -> 5}}, 
      VertexLabels -> "Name", ImagePadding -> 10] ; 

谢谢。

回答

0
In[1]:= g = Graph[{1 \[DirectedEdge] 2, 2 \[DirectedEdge] 3, 3 \[DirectedEdge] 1}, 
    Properties -> {"GraphProperties" -> {"Norm" -> 1}}]; 
g2 = SetProperty[g, Properties -> {"GraphProperties" -> {"Norm" -> 5}}]; 
PropertyValue[#, "Norm"] & /@ {g, g2} 


Out[1]= {1, 5} 
0

这可能工作:

Graph[G, Properties -> {"GraphProperties" -> {"Norm" -> 1}}] 

一般来说,你应该避免创建以大写字母开头的符号名,所以在未来使用g