Graphical description language graphml (1): Basic Concepts

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.