Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/graph_engine.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,10 @@ function Graphs.edges(model::Model, node::NodeLabel, nodedata::NodeData, propert
return (model[node, dst] for dst in MetaGraphsNext.neighbor_labels(model.graph, node))
end

function MetaGraphsNext.code_for(graph::MetaGraph, label::NodeLabel)
return label.global_counter
end

Graphs.degree(model::Model, label::NodeLabel) = Graphs.degree(model.graph, MetaGraphsNext.code_for(model.graph, label))

abstract type AbstractModelFilterPredicate end
Expand Down
2 changes: 1 addition & 1 deletion test/graph_engine_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ end
@test has_edge(model, b, a)
@test length(edges(model)) == 1

c = NodeLabel(:c, 2)
c = NodeLabel(:c, 3)
model[c] = NodeData(ctx, FactorNodeProperties(fform = sum))
@test !has_edge(model, a, c)
@test !has_edge(model, c, a)
Expand Down