SpiderWeb

SpiderWeb is a .NET library providing functionality for preforming calculations on graphs. The library is created with a special focuse on the integration of graphs and graph related theroies (e.g. SpaceSyntax) in parametric design envoirnments. Therefore special Versions are avalible for:

Grasshopper
DesignScript (planned)

Any feedback, questions or critic is welcomed.

Documents

General introduction into graph theory

Documentation and samples

.NET documentation for SpiderWebLibrary.dll and GH_SpiderWebLibrary.dll

Get all vertices in each subgraph (for disjoint graph)

Hi,

Could someone please help me with a subgraph problem.

I have a datatree of integers where each path represents all the connections of the index of the path, e.g.

{0}-3;4

{1}-2

{2}-1;3

{3}-0;2;4

{4}-0;3

{5}-6;7

{6}-5;7

{7}-5;6

Here it can be shown that there are two subgraphs containing 0,1,2,3,4 and 5,6,7. How can I use spiderweb (either using scripting or the components) to give me this result when I have many more vertices??

Thanks,

Sam

  • up

    Richard Schaffranek

    Dear Sam,

    best thing to do would be scripting. You can start with the following to load the spiderweb dll's into a vb or c# component 

    http://www.gbl.tuwien.ac.at/_docs/GrasshopperScriptum/GrasshopperSc...

    Then you would need to construct the graph (which you could do easily outside with the graph from datatree component, parse Vertex List) and start using BFS on a randomly selected vertex. All points that have a distance smaller than infinity can be accessed. So this gives you the first subgraph. Continue to do this as long as not all subgraphs are found.

    A second solution would be to compute the eigenvalues and eigenvectors of the matrix representation, but this is still a bit slow since the implementation used in spiderweb needs to compute all eigenvectors...

    Hope that helps

    Richard