0
$\begingroup$

I have an adjacency matrix given by am. I want to generate all possible subgraphs with 6 nodes. Here is the code I am using to generate them.

But, I am getting some error:

    am = Uncompress[ "1:eJzt20FKBDEQBdAe8CKexa0rj+BC6JWL8f44s0kxRSekklT+r+5svhls8OfRBNHU+/\
fv18/Htm33t0d87ve/10/74+\
u2356xsUW21Y22s8KVjnRty4aUwuU3l61tMOEjXCkKr5c3LH+\
Xo30W17QhQNQWQlpX4HKeEiY0kHDYN9fear5wLW7PrpyD6JDtxj3LKTGhVfebG1F41rvei\
Csd1QofRMI9uNJRrfDBIdyNKx3VCh9w4TG40lGt8IEUHogrHdUKHyDh0bjSUa3wMV/\
YBVc64kkbW5HjerQNJjwDl+6UmHVAAN7c6whPw5WiagUNX+\
G5uFJUraDhJgzAlaJqBQ0PYRSuFFUraAwWhuJKUShpm1zFc3jco8r4GpV85eeYcOlOiaJc\
xXNMuNJRrfBhEk4f6XBVx9DCnLivHaMJp0eIcaUovkaOr/\
zI0S1Hzg3JrvA1KiN7y5FuG5ynRDHKtxzptkFXqBi1F/E4d8XZKoXpIh7TXpi65CJ7bT/\
Yrihb2X9bIH6HmVo9o/\
G3hSXcilvLt4RbcWs7LuFWXNOG4HuhEzYNnFRsaAk34C5hH1w72hK24dqbEQvPip6Bk7Av\
srTy/RndAycRhWedEmMGTpawD64d7TrCowdOlrAPrh3t7MJ+\
AydL2HvgxCSMInXrMm0m4or/45g7E1FmZjoglGtbK8BMxHX+Ao+aibiEMHQm4uzC+\
JmIEwvjbznWCkNJs4WK1fC4nHxDOpPgVrZljoP2dLgRhXOnBBOu1IstnIIOV7WNyJzaE+\
OmjtGEU91/ezvuGg=="];

    g = AdjacencyGraph[am]
    << IGraphM`
    n = 6;
    trees = IGFromPrufer /@ Tuples[Range[n], {n - 2}];
    trees = DeleteDuplicatesBy[trees, CanonicalGraph];
    Monitor[res = 
        Table[IGLADFindSubisomorphisms[trees[[i]], g], {i, 
          Length[trees]}]; // AbsoluteTiming, i]
    subgraphNodes = DeleteDuplicates[Sort /@ Catenate@Values[res]]

The error I am getting is:

IGraphM::error: lad.c:1511 - Cannot search for a directed pattern in an undirected target or vice versa

IGraphM::error: igraph returned with error: Invalid value

IGraphM::error: lad.c:1511 - Cannot search for a directed pattern in an undirected target or vice versa

General::stop: Further output of IGraphM:: error will be suppressed during this calculation.

How can I resolve this?

$\endgroup$
  • $\begingroup$ Impossible to reproduce without the matrix am. $\endgroup$ – Henrik Schumacher May 20 '19 at 14:13
  • $\begingroup$ @HenrikSchumacher, I have the matrix am. Monitor[res = Table[IGLADFindSubisomorphisms[trees[[i]], g], {i, Length[trees]}]; // AbsoluteTiming, i] is giving me the error. $\endgroup$ – dipak narayanan May 20 '19 at 14:20
  • $\begingroup$ You have it, but not us. $\endgroup$ – Henrik Schumacher May 20 '19 at 14:24
  • 1
    $\begingroup$ What version of IGraph/M are you using, on what operating system? I cannot reproduce this problem. Check with IGVersion[]. $\endgroup$ – Szabolcs May 20 '19 at 15:37
  • 1
    $\begingroup$ You just changed the code in the question. Next time be careful and post the actual code. It's not nice to sneakily make changes like this. I just wasted some time trying to figure out why I get a directed graph on Windows but undirected on Mac ... Well, it was not Windows vs Mac. It was you changing the code without mentioning it. $\endgroup$ – Szabolcs May 20 '19 at 21:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.