Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Expand a subgraph inside the space of a graph
ResourceFunction["SubgraphExpand"][g,{v1,v1,…},r] selects the subgraph of graph consisting of all edges between only those vertices of g whose GraphDistance through g to the nearest vertex vi is less than or equal to radius r. | |
ResourceFunction["SubgraphExpand"][g,sg,r] accepts subgraph sg as the initial value (or kernel) of the expansion. |
Expand a cycle graph around one vertex:
| In[1]:= | ![]() |
| Out[1]= |
Expand a grid graph around its central vertex at several radii:
| In[2]:= |
| Out[2]= | ![]() |
Use directed edges to only expand the grid graph into the Northeast quadrant:
| In[3]:= |
| Out[3]= | ![]() |
Expand a graph around multiple initial vertices:
| In[4]:= | ![]() |
| Out[4]= | ![]() |
Define a graph:
| In[5]:= |
| Out[5]= | ![]() |
Extract a subgraph:
| In[6]:= |
| Out[6]= | ![]() |
Expand that subgraph by radius one:
| In[7]:= |
| Out[7]= | ![]() |
SubgraphExpand does not recognize subgraph isomorphism:
| In[8]:= | ![]() |
| Out[8]= | ![]() |
This can be fixed by manually choosing vertices:
| In[9]:= | ![]() |
| Out[9]= | ![]() |
Expand a polyhedral skeleton graph into three dimensions:
| In[10]:= | ![]() |
| Out[10]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License