Skip to content

test for layout_with_fr() #2211

@maelle

Description

@maelle

In #2058

The test fails, is the following surprising (the result changing every time):

library(igraph)
#> 
#> Attaching package: 'igraph'
#> The following objects are masked from 'package:stats':
#> 
#>     decompose, spectrum
#> The following object is masked from 'package:base':
#> 
#>     union

withr::with_seed(42, {
  g <- make_star(30)
  l <- layout_with_fr(g, niter = 500, dim = 3, start.temp = 20)
})
sum(l)
#> [1] -139.0961

withr::with_seed(42, {
  g <- make_star(30)
  l <- layout_with_fr(g, niter = 500, dim = 3, start.temp = 20)
})
sum(l)
#> [1] -275.7935

withr::with_seed(42, {
  g <- make_star(30)
  l <- layout_with_fr(g, niter = 500, dim = 3, start.temp = 20)
})
sum(l)
#> [1] -26.29641

Created on 2025-10-14 with reprex v2.1.1

The test has an expectation on sum(l) which can't be true since the result changes. I searched for layout in the changelog.

@szhorvat

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions