图形描述语言GraphML(1):基本概念
2008-01-23 11:32
399 查看
GraphML用于定义图形(graph),对于下面的一个简单图形,
<?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="n9"/>
<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="n9"/>
<edge source="n8" target="n10"/>
</graph>
</graphml>
可以看出,GraphML中关于图形的一些基本概念如下:
<graph id="G" edgedefault="directed">
<node id="n0"/>
<edge source="n0" target="n2"/>
<node id="n1"/>
<node id="n2"/>
</graph>
2.有向图和无向图可以混合定义。
Graph中必须指定
<?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="n9"/>
<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="n9"/>
<edge source="n8" target="n10"/>
</graph>
</graphml>
可以看出,GraphML中关于图形的一些基本概念如下:
<graph id="G" edgedefault="directed">
<node id="n0"/>
<edge source="n0" target="n2"/>
<node id="n1"/>
<node id="n2"/>
</graph>
2.有向图和无向图可以混合定义。
Graph中必须指定
edgedefault
属性
(
“
directed”
或“
undirected”)
,
Edge
中也可以单独设置
directed
为
true
或
false
。
3.对于只有一个端点(endpoint)的Edge(称为循环边loop edge,自循环selfloop edge,或反射边reflexive edig),是通过为edge的source 和 target 属性设置相同的值来定义的。
相关文章推荐
- 图形描述语言GraphML(4):复杂图形(嵌套,超边,端口)
- 图形描述语言GraphML(5):扩展 GraphML
- 图形描述语言GraphML(6):参考资料
- 图形描述语言GraphML(2):扩展属性
- 图形描述语言GraphML(3):图形元数据
- Linux命令之dot - 绘制DOT语言脚本描述的图形
- 汇编语言基本概念(续10)
- [C语言程序设计_现代方法(第2版)] 第二章 C语言基本概念
- 汇编语言基本概念(续3)
- MSDN中对进程和线程的一些基本概念的描述
- inux命令之dot - 绘制DOT语言脚本描述的图形
- inux命令之dot - 绘制DOT语言脚本描述的图形
- C语言基本概念(2)
- C语言基本概念
- 第07天OC语言(07):字符串基本概念
- R语言实战笔记--第六&七章 统计图形介绍及基本统计方法
- 自动化(Automation)基础概念:接口描述语言(IDL)与类型库(TypeLib)
- R语言实战 - 基本图形(3)- 直方图
- 图形界面的基本概念
- R语言实战 - 基本图形(4)- 核密度图