infomap_ecology_package icon indicating copy to clipboard operation
infomap_ecology_package copied to clipboard

Cannot use relax rates with extended format of intralayer edges.

Open PritchardAJP opened this issue 2 weeks ago • 1 comments

Hello,

Thank you for creating and supporting this package!

I had been running my code with no issues on my computer, but - when transferring my code to a new computer - I am getting a consistent error.


 MLNet <- create_multilayer_network(list_of_layers = UniAdj, layer_attributes = layer_attrib,
                                       interlayer_links = NULL, bipartite = F, directed = (flow == "directed"))

  listR <- list()
  MLNet$inter <- NULL
  relaxrate_modules <- NULL

  for (r in seq(0.001,1, by = 0.0999)){
   
   modules_relax_rate <- run_infomap_multilayer(MLNet, relax = T, flow_model = flow, silent = T, trials = 200, seed = 497294,  multilayer_relax_rate = r, multilayer_relax_limit_up = 1, multilayer_relax_limit_down = 0, temporal_network = T)

    listR[[length(listR) + 1]] <- modules_relax_rate
    names(listR)[length(listR)] <- r
    modules_relax_rate$modules$relax_rate <- r
    relaxrate_modules <- rbind(relaxrate_modules, modules_relax_rate$modules)
  }

This is the error, which breaks at the first step of the for loop:

[1] 0.001
Infomap version 2.7.1 compiled with OpenMP
See www.mapequation.org for terms of use.
Error in run_infomap_multilayer(NEE2017, relax = T, flow_model = flow,  : 
  Cannot use relax rates with extended format of intralayer edges.

It seems that the run_infomap_multilayer function is scanning my MLNet object to see if there are five columns. To be clear, I have no interlayer connections and am relying on the relax rate's 'teleportation' to toggle community flow through a temporal network.

> table(MLNet$extended_ids$layer_from == MLNet$extended_ids$layer_to)

TRUE 
 838

> head(MLNet$extended_ids)
# A tibble: 6 × 5
  layer_from node_from layer_to node_to weight
       <int>     <int>    <int>   <int>  <dbl>
1          1         1        1      14      2
2          1         1        1      15      3
3          1         1        1      16      1
4          1         1        1      35      1
5          1         2        1      11      1
6          1         2        1      26      1

I am not sure what version of InfoMapEcology I was using on my other computer, but this computer is using the most up to date version. My code was working on the other machine as of 6/20/2025. I can see what version of infomap that had, if necessary. Though the old version of create_multilayer_object() had an intra_output_extended=F argument, I cannot find where that would be applicable in the present code.

Please advise at your earliest convience.

Edited to remove italics formatting from code, as it just showed up in the code as double asterisks.

PritchardAJP avatar Nov 13 '25 20:11 PritchardAJP