Skip to content

EDIT: get_weight is reading the correct weight #20

@hdavid16

Description

@hdavid16

Since the weight matrix is actually the transpose of the weight matrix (sbromberger/SimpleWeightedGraphs.jl#65 (comment)), the wrong value is being read in the current implementation:

julia> s = SimpleWeightedDiGraph([1,2,1], [2,1,2], [1,1,1])
{2, 2} directed simple Int64 graph with Int64 weights     

julia> get_weight(s,1,2)
2

Which is wrong because the weight of the Edge 1 => 2 is 1, not 2. This occurs because, get_weight is calling s.weights[2,1]. However, the weights field is not transposed.

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