#step1: cycle definition
      ciclo=[(0,0,0)]
      for j=1:(size(Cb,2))
        if (Cb[i,j]!=0)
          push!(ciclo,(BrancheS[j].line, BrancheS[j].from, BrancheS[j].to))
        end
      end
      ciclo=ciclo[2:end]

      #step3: cycle capacity
      y=0
      for f=1:length(ciclo)
      y+=BrancheS[ciclo[f][1]].p_flow_max
      end

      #step2: subcycle definition and preliminary filtering on subcycles
      sottociclo=collect(combinations(ciclo,0))
      for z=1:length(ciclo)
        if(2*BrancheS[ciclo[z][1]].p_flow_max>y)
          sottociclo=union(sottociclo,[ciclo[z]])
        end
      end
        for f=2:length(ciclo)
          sottociclo=union(sottociclo,combinations(ciclo,f))
        end
      sottociclo=sottociclo[2:end]

Il giorno martedì 27 ottobre 2015 16:12:51 UTC+1, Tom Breloff ha scritto:
>
> The first row should be a vector of tuples, just like the other elements.  
> Please 
> post the code which generates sottociclo and maybe we can help further. 
>
> On Tuesday, October 27, 2015, Michela Di Lullo <[email protected] 
> <javascript:>> wrote:
>
>> Hello everyone,
>>
>> I have: 
>>
>> *sottociclo*
>>
>> *5-element Array{Any,1}:*
>>
>> * (1,2,5)                  *
>>
>> * [(1,1,2),(2,1,5)]        *
>>
>> * [(1,1,2),(5,2,5)]        *
>>
>> * [(2,1,5),(5,2,5)]        *
>>
>> * [(1,1,2),(2,1,5),(5,2,5)]*
>>
>>
>> *julia> **length(sottociclo[1])*
>>
>> *3*
>>
>>
>> *julia> **length(sottociclo[2])*
>>
>> *2*
>>
>> How might I modify the code such that *length(sottociclo[1])=1? *
>> I need length(sottociclo[*]) be equal to the number of tuple in row *...
>> Thanks in advance for any help,
>>
>> Michela 
>>
>

Reply via email to