How can I change the Graph required data such as EdgeWeight,VertexWeight,EdgeCapacity,VertexCapacity in the Graph?

I asked this question in different form and because I couldn't receive the proper answer so I have to change my question.I know that was my fault sorry.I need to change the Matrix Data of nodes and edges in the graph. How can I do that on the graph itself by clicking on each node?

Graph[{"Uppsala" -> "Marsta", "Marsta" -> "Uppsala", "UpplandsVasby" -> "Sollentuna", "Sollentuna" -> "UpplandsVasby",
"UpplandsVasby" -> "Marsta", "Marsta" -> "UpplandsVasby",
"Stockholm" -> "Boo", "Boo" -> "Stockholm",
"Stockholm" -> "Lidingo", "Lidingo" -> "Stockholm",
"Stockholm" -> "Sollentuna", "Sollentuna" -> "Stockholm",
"Stockholm" -> "Taby", "Taby" -> "Stockholm"},EdgeWeight -> RandomInteger[{10, 100}, 14]
VertexLabels -> "Name"]

-
What is Matrix Data? –  belisarius May 13 '13 at 14:03
You can't do it by clicking on each node. You need to enter commands to set these properties. The command to look up is SetProperty. –  Szabolcs May 13 '13 at 14:04
Can you clarify if your question is about how to set the weights, or about how to set the weights using a graphical point-and-click interface? –  Szabolcs May 13 '13 at 14:09

The function to use to set properties on graphs is SetProperty. Sometimes this function can be a bit inconsistent and difficult to figure out, but this time the standard syntax works:

SetProperty[{g, "Uppsala" \[DirectedEdge] "Marsta"}, EdgeWeight -> 15]


You could also use

SetProperty[g, EdgeWeight -> {"Uppsala" \[DirectedEdge] "Marsta" -> 20}]


Note the use of \[DirectedEdge] instead of ->. You can enter it using esc de esc. Also note that SetProperty does not change the graph g. It simply return a new graph with the selected property changed. If you need to change the graph, use g = SetProperty[g, ...].

-
How can I change on the graph not in the coding?I mean in an interactive just by clicking? –  Alex May 13 '13 at 14:51
@Alex I am not aware of any solution for that in Mathematica. You'd have to write one. You can use some other program (Gephi? Cytoscape? not sure if they can do this), construct the graph, export it to GraphML or a similar format, then import it to Mathematica. –  Szabolcs May 13 '13 at 16:21