GraphmlUsed to define graphics (Graph),For the following simple image,
Graphml is described as follows:
<? XML version = "1.0" encoding = "UTF-8" ?>
< Graphml Xmlns = "Http://graphml.graphdrawing.org/xmlns"
Xmlns: xsi = "Http://www.w3.org/2001/XMLSchema-instance"
Xsi: schemalocation = "Http://graphml.graphdrawing.org/xmlns
Http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd" >
< Graph ID = "G" Edgedefault = "Undirected" >
< Node ID = "N0" />
< Node ID = "N1" />
< Node ID = "N2" />
< Node ID = "N3" />
< Node ID = "N4" />
< Node ID = "N5" />
< Node ID = "N6" />
< Node ID = "N7" />
< Node ID = "N8" />
< Node ID = "Success" />
< Node ID = "N10" />
< Edge Source = "N0" Target = "N2" />
< Edge Source = "N1" Target = "N2" />
< Edge Source = "N2" Target = "N3" />
< Edge Source = "N3" Target = "N5" />
< Edge Source = "N3" Target = "N4" />
< Edge Source = "N4" Target = "N6" />
< Edge Source = "N6" Target = "N5" />
< Edge Source = "N5" Target = "N7" />
< Edge Source = "N6" Target = "N8" />
< Edge Source = "N8" Target = "N7" />
< Edge Source = "N8" Target = "Success" />
< Edge Source = "N8" Target = "N10" />
</ Graph >
</ Graphml >
It can be seen that some basic concepts about graphics in graphml are as follows:
Note the following:
1. GraphElement in(Element)No order requirements
For example, the followingGraphIs correct:
< Graph ID = "G" Edgedefault = "Directed" >
< Node ID = "N0" />
< Edge Source = "N0" Target = "N2" />
< Node ID = "N1" />
< Node ID = "N2" />
</ Graph >
2. directed Graphs and undirected graphs can be mixed and defined.
graph medium required specify edgedefault
Attribute
(
"
Directed"
Or"
Undirected ")
,
Edge
You can also set it separately.
Directed
Is
True
Or
False
.
3. For scenarios with only one endpoint(Endpoint) OfEdge ( Called cyclic edgeLoop edge, Self-LoopSelfloop edge, Or reflection sideReflexive edig ), YesEdge OfSource AndTarget Set the same attribute value to define.