Skip to content

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

@HLWeil

Description

@HLWeil

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions