commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Carman <>
Subject Re: [Graph] On graph weight type(s)
Date Thu, 15 Dec 2011 11:35:14 GMT
It would be very similar to how we discussed either using Comparable
objects or providing a Comparator.  So, you'd either use Summable (or
whatever it's called) objects or allow the user to provide a
BinaryOperation object (that matches the type of course):

public interface BinaryOperation<T>
  public T execute(T operand1, T operand2);

Perhaps we can come up with an interface that combines the two
aspects.  I'm trying to think of mathematically what that would be
called.  By the way, what do you need to know "HasZero"?  A sum
operation has to have a "zero", doesn't it?   Well, I guess I'm
considering weights to be a "group" in the abstract algebra sense.  If
so, then they'd have to follow the properties of a group and thus
there would exist an identity ("zero" for sum operation) element.

On Wed, Dec 14, 2011 at 7:26 AM, Claudio Squarcella
<> wrote:
> Hi,
> On 14/12/2011 12:34, James Carman wrote:
>> I don't like the idea of pushing the adding, comparing, etc. into the
>> weights.  I like the idea of having operations external to the weights
>> that take care of that stuff.
> I would be happy with non-polluted weights, so I am with you. But I am not
> quite sure how to translate that into a good implementation. Do you have an
> idea to share?
> Thanks,
> Claudio
> --
> Claudio Squarcella
> PhD student at Roma Tre University
> E-mail address:
> Phone: +39-06-57333215
> Fax: +39-06-57333612
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message