|
QuickGraph and GraphLight are both excellent!
Quick Graph(http://quickgraph.codeplex.com) is a generic Graph Data Structures and Algorithms for .NET (support SL; without supporting Layout).
I'm now using the two framework in my work. There are some things that can be optimized:
1. The graphviz parser in GraphLight.
(1) If there is no "nodes:" and "edges:" in data file , parser errors will occur:
digraph G {
0 ;
1 ;
2 ;
3 ;
4 ;
5 ;
6 ;
7 ;
8 ;
9 ;
0 -> 1 [];
0 -> 2 [];
0 -> 3 [];
0 -> 4 [];
0 -> 5 [];
0 -> 6 [];
0 -> 7 [];
0 -> 8 [];
0 -> 9 [];
}
QuickGraph can output this kind of data. I don't know whether it fit the graphviz standards...
(2) I tried to update outputing format. parser errors also occured.
digraph G {
center=true
0 [label="RDF评论词汇表"];
1 [label="评论", tooltip="对一项事物的评论。"];
2 [label="注释", tooltip="关于一个评论的注释。"];
3 [label="反馈", tooltip="对评论的反馈,表达了这条评论是否有用。"];
4 [label="评级", tooltip="一个数值。"];
5 [label="文本", tooltip="评论的文本。"];
6 [label="有评论", tooltip="关联一个事物和一条评论。"];
7 [label="评论者", tooltip="撰写评论的人。"];
8 [label="最小评级", tooltip="一个数值"];
9 [label="最大评级", tooltip="一个数值"];
0 -> 1 [ comment="RelatedClass"];
0 -> 2 [ comment="RelatedClass"];
0 -> 3 [ comment="RelatedClass"];
0 -> 4 [ comment="Property"];
0 -> 5 [ comment="Property"];
0 -> 6 [ comment="Property"];
0 -> 7 [ comment="Property"];
0 -> 8 [ comment="Property"];
0 -> 9 [ comment="Property"];
}
I think the problem is GRAPH() in MyParser class. Between NODES() and EDGES(), there maybe are some graph attributes that should be processed. ^0^
2 QuickGraph.Collectios and QuickGraph.Collections can integrated together.
3 I integrated the two frameworks using a lazy and dirty method:
public static DrawingGraph Convert( LoreSchemaGraph g, string graphLabel )
OK. Like the data i listed above. If there is one core node and many different nodes linked to it. Then the rendered result will be:
N0
N1 N2 N3 N4 N5 N6 N7 N8 N9 N10 N11 N12 N13
I leave out the edges in the example. If the graph has many linked nodes, the graph will be very ugly.
The algorithm should be like a circle?
N1 N2 N3 N4
N5 N0 N6
N7 N13
N8 N9 N10 N11 N12
Best regards
Jerin
|