tags:

views:

113

answers:

2

We have a program which perform graph analysis (namely Maximum-flow problem) on several graphs. There is also the opportunity to process these in parallel.

There is already a large C# Code base, but we are intending to rewrite a large portion of this. Would it be better to do this type of operation in F#, as opposed to say C#?

Thanks, Pete

+5  A: 

I think that this depends largely on the composition of your team - how well do you know F#?

I feel like I am able to develop almost anything more quickly in F# than C#. In particular, highly algorithmic programs are often more concise and readable when expressed in F# thanks to type inference. However, if you don't have much experience with F# there is a significant learning curve, which means that you may be better off sticking to C# if you already know that language well.

C#'s support for doing operations in parallel is roughly equivalent to F#'s, particularly if your task doesn't require accessing any shared mutable state (which seems to be the case for your task). If I understand your problem correctly, you'd just like to run the same operation on multiple graphs at the same time, which ought to be quite easy in either language. If you were trying to parallelize the max-flow algorithm itself, then F# might be a bit easier due to its stronger support for immutable data types. Where F# really beats C# is in doing asynchronous operations, but that seems less relevant here.

kvb
Experience of F# - none really. So I think you're right.We have also identified a library called QuickGraph to handle all the operations on the Graph and even includes an algorithm for calculating maximum flow automatically.So looks like we'll go with that. Cheers.
peter.swallow
A: 
Jon Harrop