Skip to content

WIP: Add a function to update edge weights of a certain vertex#40

Open
rohitvarkey wants to merge 1 commit intomasterfrom
foralledgeupdates
Open

WIP: Add a function to update edge weights of a certain vertex#40
rohitvarkey wants to merge 1 commit intomasterfrom
foralledgeupdates

Conversation

@rohitvarkey
Copy link
Copy Markdown
Collaborator

To solve the case in #38 where all edge weights of a vertex has to be updated.

@edward-kao can you try using this and see how it performs on your graph?

I wonder if wts should also store direction to prevent the wrong edge being updated.

@rohitvarkey
Copy link
Copy Markdown
Collaborator Author

julia> using StingerGraphs

julia> s = Stinger()
Oct 25 18:05:52  stinger[49621] <Warning>: stinger_new_full 827: Resizing stinger to fit into memory (detected as 4294967296)
StingerGraphs.Stinger(Ptr{Void} @0x0000000127c5c000)

julia> for i=1:5
                                              insert_edge!(s, 0, 0, i, i, 0)
                                          end

julia> foralledges(s, 0) do e, src, etype
                @show e.weight
         end
e.weight = 1
e.weight = 2
e.weight = 3
e.weight = 4
e.weight = 5

julia> wts = Dict{Int64, Int64}()
Dict{Int64,Int64} with 0 entries

julia> for i=1:5
           wts[i] = i
       end

julia> foralledgesupdatewts(s, 0, wts)

julia> foralledges(s, 0) do e, src, etype
                @show e.weight
          end
e.weight = 2
e.weight = 4
e.weight = 6
e.weight = 8
e.weight = 10

@ehein6
Copy link
Copy Markdown

ehein6 commented Oct 25, 2017

This solves a very specific problem. I would rather that we find a way to make the edge weights writable directly from Julia.

@edward-kao
Copy link
Copy Markdown

I checked out this branch with the foralledgeupdates function. I can see it in traversal.jl, but after rebuilding by running /deps/build.jl, foralledgesupdatewts is still not defined. Maybe I am not re-building Julia-Stinger correctly?

@rohitvarkey
Copy link
Copy Markdown
Collaborator Author

@ehein6 I agree. This is more of a stopgap for now.

@edward-kao That's pretty weird. You should need to run deps/build.jl only when the STINGER version is updated. Is the cloned package which you've checked out in your Julia package dir (typically ~/.julia/0.6/StingerGraphs)?

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

Successfully merging this pull request may close these issues.

3 participants