15,900,725 members
Home / Discussions / Algorithms

# Algorithms

 Vector representation of the code. Member 1406583326-Nov-18 7:50 Member 14065833 26-Nov-18 7:50
 Re: Vector representation of the code. Gerry Schmitz27-Nov-18 9:19 Gerry Schmitz 27-Nov-18 9:19
 Re: Vector representation of the code. shooky561-Dec-18 5:04 shooky56 1-Dec-18 5:04
 Optimal Task Scheduling with Complete Knowledge Member 140435574-Nov-18 12:11 Member 14043557 4-Nov-18 12:11
 Re: Optimal Task Scheduling with Complete Knowledge Mycroft Holmes4-Nov-18 19:31 Mycroft Holmes 4-Nov-18 19:31
 Re: Optimal Task Scheduling with Complete Knowledge Member 140435575-Nov-18 1:37 Member 14043557 5-Nov-18 1:37
 Re: Optimal Task Scheduling with Complete Knowledge Gerry Schmitz12-Nov-18 8:20 Gerry Schmitz 12-Nov-18 8:20
 Chess Futility pruning GM Fafkorn5-Oct-18 22:13 GM Fafkorn 5-Oct-18 22:13
 I'm creating a chess engine and I've tried to implement futility pruning. Results are sometimes worse than without it. Could somebody tell me what I'm doing wrong? My margin is set on 601 (pawn is set 200, knight/bishop 600 for example) Thanks ```Same position without futility on depth 5 Score: 90 Nodes: 89383 Depth: 5 Time: 2011ms with futility on depth 5 Score: 90 Nodes: 85808 Depth: 5 Time: 1867ms without futility on depth 6 Score: -16 Nodes: 836935 Depth: 6 Time: 12360ms with futility on depth 6 Score: 65 Nodes: 855792 Depth: 6 Time: 12544ms``` Java ```
private int negamax(Position node, int depth, int alpha, int beta, int color, byte castling) {         if(depth == 0) {             return quiescenceSearch(node, alpha, beta, color);         }         //         //futility pruning         //         if(depth == 1) {             int staticEval = color * countScore(node.pieces, depth, node.prevI, node.i);             if(staticEval + margin < alpha) {                 return staticEval;             }         }         //         //generating moves         //         ArrayList possibleMoves = generateMove(node.pieces, node.prevI, node.i, getMoveByColor(color), castling);          if(possibleMoves.size() == 0) {             return color * countScore(node.pieces, depth, node.prevI, node.i);         }          orderMoves(possibleMoves, node.pieces);          int value = MIN;         for (Move possibleMove : possibleMoves) {             Piece tempPiece = node.pieces[possibleMove.getI()];             int prevPiece = node.pieces[possibleMove.getPrevI()].getType();             node.pieces[possibleMove.getPrevI()].move(possibleMove.getI(), possibleMove.getPrevI(), node.pieces, 0);             byte tempCastling = setCastling(node.prevI, node.i, castling);             Move temp = new Move(node.i, node.prevI);             node.prevI = possibleMove.getPrevI();             node.i = possibleMove.getI();              int tempValue;             tempValue = -negamax(node, depth - 1, -beta, -alpha, -color, tempCastling);              value = Math.max(value, tempValue);             undo(possibleMove.getI(), possibleMove.getPrevI(), node.pieces, tempPiece, prevPiece);             node.prevI = temp.getPrevI();             node.i = temp.getI();             alpha = Math.max(alpha, value);             if (depth == searchDepth) {                 if (value > bestMoveValue) {                     bestMoveValue = value;                     bestMove = new Move(possibleMove.getI(), possibleMove.getPrevI());                 }             }         }         return value;     }```
 Algorithms help Member 139775798-Sep-18 7:36 Member 13977579 8-Sep-18 7:36
 Start with a group of size X, divide it into Y groups, Z times, minimize overlap Member 139396526-Aug-18 5:08 Member 13939652 6-Aug-18 5:08
 Re: Start with a group of size X, divide it into Y groups, Z times, minimize overlap Stefan_Lang7-Aug-18 23:29 Stefan_Lang 7-Aug-18 23:29
 Re: Start with a group of size X, divide it into Y groups, Z times, minimize overlap Gerry Schmitz8-Aug-18 8:38 Gerry Schmitz 8-Aug-18 8:38
 Re: Start with a group of size X, divide it into Y groups, Z times, minimize overlap Stefan_Lang8-Aug-18 21:12 Stefan_Lang 8-Aug-18 21:12
 Re: Start with a group of size X, divide it into Y groups, Z times, minimize overlap Gerry Schmitz9-Aug-18 9:52 Gerry Schmitz 9-Aug-18 9:52
 Re: Start with a group of size X, divide it into Y groups, Z times, minimize overlap Stefan_Lang9-Aug-18 21:42 Stefan_Lang 9-Aug-18 21:42
 Re: Start with a group of size X, divide it into Y groups, Z times, minimize overlap Kenneth Haugland9-Aug-18 22:25 Kenneth Haugland 9-Aug-18 22:25
 Re: Start with a group of size X, divide it into Y groups, Z times, minimize overlap Gerry Schmitz11-Aug-18 9:19 Gerry Schmitz 11-Aug-18 9:19
 Re: Start with a group of size X, divide it into Y groups, Z times, minimize overlap Gerry Schmitz10-Aug-18 7:38 Gerry Schmitz 10-Aug-18 7:38
 Re: Start with a group of size X, divide it into Y groups, Z times, minimize overlap Stefan_Lang27-Aug-18 0:25 Stefan_Lang 27-Aug-18 0:25
 Re: Start with a group of size X, divide it into Y groups, Z times, minimize overlap Patrice T1-Sep-18 16:42 Patrice T 1-Sep-18 16:42
 Simplex Downhill... User 110609793-Aug-18 9:35 User 11060979 3-Aug-18 9:35
 Re: Simplex Downhill... Stefan_Lang5-Aug-18 21:33 Stefan_Lang 5-Aug-18 21:33
 Re: Simplex Downhill... User 110609796-Aug-18 4:47 User 11060979 6-Aug-18 4:47
 Re: Simplex Downhill... Stefan_Lang7-Aug-18 2:21 Stefan_Lang 7-Aug-18 2:21
 Re: Simplex Downhill... User 110609797-Aug-18 21:23 User 11060979 7-Aug-18 21:23
 Last Visit: 31-Dec-99 18:00     Last Update: 18-May-24 2:54 Refresh ᐊ Prev1...19202122232425262728 Next ᐅ