Skip to content
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

[Bug] Undirected edges.map can lead to unequal edgeweights #12

Open
HLWeil opened this issue Sep 16, 2020 · 0 comments
Open

[Bug] Undirected edges.map can lead to unequal edgeweights #12

HLWeil opened this issue Sep 16, 2020 · 0 comments

Comments

@HLWeil
Copy link
Member

HLWeil commented Sep 16, 2020

Repro steps

open FSharp.FGL.Undirected

let rnd = System.Random()

let myGraph = 
   FSharp.FGL.Directed.Models.gilbert (fun i -> i,i) 4 0.3
   |> FSharp.FGL.Directed.Edges.undirect (fun _ _ -> 1)

myGraph 
|> Edges.map (fun _ _ _ -> rnd.NextDouble())`

Expected behavior

Edge from 0 -> 1 and 1 -> 0 should have the same weights

Actual behavior

Edge from 0 -> 1 and 1 -> 0 have the different weights

Solution

The function should only be applied once and the value should be used for both "directions"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant