WIP: Add a function to update edge weights of a certain vertex#40
Open
rohitvarkey wants to merge 1 commit intomasterfrom
Open
WIP: Add a function to update edge weights of a certain vertex#40rohitvarkey wants to merge 1 commit intomasterfrom
rohitvarkey wants to merge 1 commit intomasterfrom
Conversation
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 |
|
This solves a very specific problem. I would rather that we find a way to make the edge weights writable directly from Julia. |
|
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? |
Collaborator
Author
|
@ehein6 I agree. This is more of a stopgap for now. @edward-kao That's pretty weird. You should need to run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
wtsshould also store direction to prevent the wrong edge being updated.