Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Biconnected Circular Graph Possible? (Read 4668 times)
agrudzien
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Aug 11th, 2009
Biconnected Circular Graph Possible?
Aug 11th, 2009 at 6:03pm
Print Post  
Biconnected Circular Graph - Each node partition represents a so-called biconnected component of the graph. Nodes that belong to more than one biconnected component are assigned exclusively to one partition. (A biconnected component consists of nodes that are reachable by two edge-disjoint paths.)

Is it possible to construct a circular graph that partitions nodes in this way. An example of what this kind of circular graph looks like can be found here.http://www.yworks.de/products/yfiles/doc/developers-guide/figures/circular-layou...

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Biconnected Circular Graph Possible?
Reply #1 - Aug 11th, 2009 at 6:29pm
Print Post  
There is no out of the box support for this layout. It looks like some combination of the radial tree and circular layout algorithms that are implemented in diagramlite. We also have some code that finds the biconnected components in a graph, so I suppose our developer could implement this for the next release.

Stoyan
  
Back to top
 
IP Logged
 
agrudzien
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Aug 11th, 2009
Re: Biconnected Circular Graph Possible?
Reply #2 - Aug 11th, 2009 at 6:40pm
Print Post  
If I could find the biconnected components I could build the graph with diagram lite.  It would be great if some features were released that can find the biconnected components in a graph.

Is there a release cycle schedule anywhere I can have a look at?  We are definiatly considering DiagramLite for our Silverlight diagraming needs.

Thanks for the reply.

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Biconnected Circular Graph Possible?
Reply #3 - Aug 11th, 2009 at 7:01pm
Print Post  
Finding biconnected components is implemented in the mindfusion.graphs.silverlight assembly. It is for our internal use and is not documented, however all types are public so you can still use it. However the assembly a different class hierarchy and you should create Graph,Vertex and Edge objects corresponding to the Diagram, DiagramNodes and DiagramLinks. You can use the following method from our graphlib test app to do that, and after finding the biconnected components, use the graph to diagram hashtables to get the corresponding diagram items.

Code
Select All
private Graph GraphFromDiagram(Diagram diagram,
	Dictionary<Vertex, DiagramNode> nodesMap, Dictionary<Edge, DiagramLink> linksMap)
{
	Graph graph = new Graph();

	foreach (DiagramNode dnode in diagram.Nodes)
	{
		Vertex vertex = new Vertex();
		graph.Vertices.Add(vertex);
		nodesMap[vertex] = dnode;
		dnode.Tag = vertex;
	}

	foreach (DiagramLink dlink in diagram.Links)
	{
		Edge edge = graph.AddEdge(dlink.Origin.Tag as Vertex, dlink.Destination.Tag as Vertex);
		linksMap[edge] = dlink;
		dlink.Tag = edge;

		int w;
		int.TryParse(dlink.Text, out w);
		edge.Weight = w;
	}

	return graph;
}
 



Here is more code from our test app that finds the biconnected components and changes the color of their items:

Code
Select All
private void btnFindBiconnected_Click(object sender, EventArgs e)
{
	Graph[] components = graph.GetBiconnectedComponents(true);

	int colorIndex = 0;
	foreach (Graph component in components)
	{
		foreach (Vertex copy in component.Vertices)
		{
			Vertex v = component.vertexCopyToOrigMap[copy];
			graphToDiagMapNodes[v].Brush = new MindFusion.Drawing.SolidBrush(colors[colorIndex]);
		}
		colorIndex++;
	}
}
 



There isn't much of a release schedule for DiagramLite, we mostly port features from the Windows Forms version and are working on TableNodes support now.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
agrudzien
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Aug 11th, 2009
Re: Biconnected Circular Graph Possible?
Reply #4 - Aug 12th, 2009 at 4:33pm
Print Post  
Thank you very much.  This gets me much closer to what I want to achieve.  I haven't got the algorythm down to layout the graph I want, I am closer. 

At this point I am having trouble with MultipleGraphPlacement and laying out ContainerNodes.  Even After I Layout each container node element by adding them to a DiagramItemCollection, then add the ContainerNodes to another DiagramItemCollection and lay those out, Container Nodes still Overlap.  Well working on it. 

Thanks again.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Biconnected Circular Graph Possible?
Reply #5 - Aug 12th, 2009 at 6:03pm
Print Post  
If there are links between the containers, are you adding them to the collection too?
  
Back to top
 
IP Logged
 
agrudzien
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Aug 11th, 2009
Re: Biconnected Circular Graph Possible?
Reply #6 - Aug 12th, 2009 at 8:16pm
Print Post  
There are not links between the containernodes.

Maybe I am approaching this the wrong way.  My approach thus far has been to figure out (using biconnected components) which nodes belong in their own containernode.  Then I am trying to treat each container node as its own graph, moving the container node to the proper location on the diagram.  This does not seem to work as moving a containernode programatically does not move the its children it seems. 

In silverlight diagramLite, is there a way to create multiple graphs or diagrams, place them on a parent diagram?

Stoyo, thank you very much for all the help so far.  I appreciate it.  I am sure I am having so much trouble with this due to my lack of expertise on graphing and diagraming.  I just started learning all this stuff Monday. 

Regards,
Adam
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Biconnected Circular Graph Possible?
Reply #7 - Aug 13th, 2009 at 3:43pm
Print Post  
Hi Adam,

You might add hosted Diagram controls to a parent diagram using ControlNodes, but in that case you wouldn't be able to draw links between nodes in different child diagrams.

Now this version of the control should correctly move the container's children when you set Bounds programmatically:
https://mindfusion.eu/_beta/diaglite_ctrbounds.zip

If in some situations you need to set container's positions without moving the children, call ctr.SetBounds(rect, false).

Our developer did some research for layout of biconnected blocks. The common approach is to build a tree where each biconnected component from the original graph is represented as a tree node, and there is a link between the nodes when the biconnected components have a common vertex. After that you can apply some kind of layout on the tree (e.g. TreeLayout, SpringLayout or AnnealLayout work fine on trees), and arrange each biconnected component independently using another layout (e.g. CircularLayout would be best for denser components).

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint