@@ -398,7 +398,8 @@ function findShortestPathDijkstra( dfg::LightDFG,
398
398
tagsFactors:: Vector{Symbol} = Symbol[],
399
399
typeVariables:: Union{Nothing, <:AbstractVector} = nothing ,
400
400
typeFactors:: Union{Nothing, <:AbstractVector} = nothing ,
401
- solvable:: Int = 0 )
401
+ solvable:: Int = 0 ,
402
+ initialized:: Union{Nothing,Bool} = nothing )
402
403
#
403
404
# helper function to filter on vector of types
404
405
function _filterTypeList (thelist:: Vector{Symbol} , typeList, listfnc= x-> ls (dfg, x) )
@@ -417,6 +418,7 @@ function findShortestPathDijkstra( dfg::LightDFG,
417
418
0 < length (tagsFactors) ||
418
419
typeVariables != = nothing ||
419
420
typeFactors != = nothing ||
421
+ initialized != = nothing ||
420
422
solvable != 0
421
423
#
422
424
dfg_ = if duplicate
@@ -425,13 +427,23 @@ function findShortestPathDijkstra( dfg::LightDFG,
425
427
fctList = lsf (dfg, regexFactors, tags= tagsFactors, solvable= solvable)
426
428
varList = typeVariables != = nothing ? _filterTypeList (varList, typeVariables) : varList
427
429
fctList = typeFactors != = nothing ? _filterTypeList (fctList, typeFactors, x-> lsf (dfg, x)) : fctList
430
+ varList = if initialized != = nothing
431
+ initmask = isInitialized .(dfg, varList) .== initialized
432
+ varList[initmask]
433
+ else
434
+ varList
435
+ end
428
436
deepcopyGraph (typeof (dfg), dfg, varList, fctList)
429
437
else
430
438
# no filter can be used directly
431
439
dfg
432
440
end
433
441
434
442
# LightDFG internally uses Integers
443
+ if ! haskey (dfg_. g. labels, from) || ! haskey (dfg_. g. labels, from)
444
+ # assume filters excluded either `to` or `from` and hence no shortest path
445
+ return Symbol[]
446
+ end
435
447
frI = dfg_. g. labels[from]
436
448
toI = dfg_. g. labels[to]
437
449
0 commit comments