-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add block and block-cactus recognition #104
Comments
As a side question, why does IGraphM have |
Originally, I did not notice
Implementing any kind of graph function is often a pain because we have to consider: directed/undirected, simple graph / multigraph / self-loops, weighted/non-weighted, and all combinations of these. If we exclude non-simple graphs, then I guess |
@jplauri Is connectedness usually required for block graphs? The current |
Technically, either (block or cactus) can be disconnected. But maybe it's ok to require connectedness in both cases (but the docs should say this) - the user can just run the recognition on each component if necessary. Would that make sense? |
Wikipedia and MathWorld include connectedness in their cactus definitions. Wikipedia also refers to cactus graphs as Husimi trees, where "tree" suggests connectedness. It mentions that "Husimi tree" is sometimes used to refer to block graphs instead, which suggests that at least some results about block graphs may assume connectedness (?) I guess the question is: what behaviour is most useful and most convenient to users?
I guess the deciding factor is if most use cases would require testing for connectedness simultaneously anyway. I'd need some input here from someone who'd find this function of use. |
On a closer thought, I think it indeed makes sense to require connectnedness here. The reason is that these graphs are often defined via a block-cut tree which is a tree of biconnected components (these blocks are then all cliques/cycles depending on what we are defining). Incidentally, I just had to do cactus recognition today so I came back to this post and perhaps hadn't seen your last post here earlier. |
IGraphM has functionality for recognizing cactus graphs (
IGCactusQ
). These are precisely the graphs whose 2-connected components are cycles. On the other hand, there is no functionality for recognizing block graphs, that is, graphs whose 2-connected components are cliques. Should such a function be added as well?For instance, this could be readily added as:
A natural variant is also given by block cactus graphs. These are the graphs for which each 2-connected component is a cycle or a clique. It should be straightforward to add such a function as well, if deemed interesting. For that, I guess there's no
CycleGraphQ
in Mathematica, but that can also be done as:Afterwards,
BlockCactusQ
would follow by replacing the conditionCompleteGraphQ
by the logical OR of the two conditions (clique or cycle).To summarize, I think all of these would be useful additions besides
IGCactusQ
:IGCycleQ
IGBlockQ
IGBlockCactusQ
The text was updated successfully, but these errors were encountered: