Skip to content

add_edge function is broken #2

@Leticia-maria

Description

@Leticia-maria

Input:

for i in 1:ncol(df), j in i+1:ncol(df) # iterate over all combinations of columns
           w = dot(df[!, i], df[!, j])        # calculate how many times (i,j) occurs
           if w > 0
               push!(ew, w)
               add_edge!(g, i, j, w)
               push!(pairings,[i,j])
           end
       end

Output:

ERROR: MethodError: no method matching add_edge!(::SimpleWeightedGraph{Int64, Float64}, ::Int64, ::Int64, ::Int64)
Closest candidates are:
  add_edge!(::LightGraphs.SimpleGraphs.AbstractSimpleGraph, ::Any, ::Any) at /home/leticia/.julia/packages/LightGraphs/IgJif/src/SimpleGraphs/SimpleGraphs.jl:90
  add_edge!(::LightGraphs.SimpleGraphs.AbstractSimpleGraph, ::Any) at /home/leticia/.julia/packages/LightGraphs/IgJif/src/SimpleGraphs/SimpleGraphs.jl:86
Stacktrace:
 [1] top-level scope
   @ ./REPL[24]:5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions